-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
size-limit report 📦
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5946282:
|
3db9546
to
770c182
Compare
770c182
to
4d26452
Compare
So, I think this should cover everything. @Andarist, I would be very grateful if you could take a look at this if I did anything horribly wrong :) |
0f1a782
to
b23a075
Compare
b23a075
to
8d62354
Compare
@@ -5,10 +5,11 @@ import replace from '@rollup/plugin-replace'; | |||
|
|||
/** @type {import("rollup").RollupOptions} */ | |||
const defaultConfig = { | |||
input: 'src/index.ts', | |||
input: ['src/index.ts', 'src/react.ts'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: any special reason why you'd like to keep using preserveModules
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was expecting this answer and it's a good one. Just a note for completeness - this doesn't quite improve tree-shaking (given my own definition of what tree-shaking is). It allows bundlers to leverage "sideEffects": false
- but this flag is a hack around tree-shaking as ideal tree-shaking in practice is sometimes hard to achieve (due to initialization side-effects that include function calls and property accesses).
Both things are not mutually exclusive though as "sideEffects": false
relies heavily on the file boundaries that you have set up as an author which might not produce 100% ideal results either.
@phryneas nothing obviously broken here 👍 it's a lot of delicate configs so I can't give any guarantees that this works, but I know you have done some manual testing already, so 🤞 |
@Andarist one bonus question: do you know how to keep it from stripping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. We'll need to update docs as well before a release. I only have one real question - do the types need to be moved from /ts/
-> /esm/ts
for a particular reason?
I'm wondering if this should also be documented in release notes, as it could be a breaking change for some folks?
Simplicity of the build. We'd need an additional step otherwise, as only the ESM build builds all entry points, but TS wants to emit only to sub-folders of the ESM build.
Hmm. It's not really "documented API" in my mind. Only what is exported from index (or other "official entry points") has a guarantee to stay the same between versions, and that entry point still exports the same types as before (minus the react ones). |
Co-authored-by: Matt Sutkowski <[email protected]>
Makes sense to me, thanks! |
Umh, yeah, forgot about this. LGTM. |
let's see how this works out
Closes #141