-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Babel7 #590
Babel7 #590
Conversation
Hm.. now everything became smaller. First commit should be starting point in diff. |
Is it stripping the second invariant argument? Eg that Babel dev plugin?
…On Thu, 28 Jun 2018 at 8:20 pm, Bogdan Chadkin ***@***.***> wrote:
Hm.. now everything became smaller. First commit should be starting point
in diff.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACFN7bDZxG_Y2F7BaWQXMpIXCYk-rUa6ks5uBK3jgaJpZM4U7HBY>
.
|
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.
33 down to 23 is great!
Nope. I didn't strip anything. Just played with babel configuration. |
Let's strip invariant in the next PR. |
Sure
…On Thu, 28 Jun 2018 at 8:34 pm, Bogdan Chadkin ***@***.***> wrote:
Let's strip invariant in the next PR.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACFN7R9XZo__Zo0SbJGFgRm7nOiX_-eqks5uBLE4gaJpZM4U7HBY>
.
|
storybook only looks for a root |
@@ -1,21 +1,26 @@ | |||
{ | |||
"dist/react-beautiful-dnd.js": { | |||
"bundled": 391074, |
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.
is this the diff on the dev branch on from master?
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.
Could you please let me know:
- what the change in numbers is between the current dev and this branch? Ie how many kbs do we loose moving to babel 7
- could you also compare this again the current master? I will put these figures in the release notes
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.
You can compare the last commit against the first commit in this PR. The first one is only snapshot update.
{
"dist/react-beautiful-dnd.js": {
- "bundled": 380027,
- "minified": 143820,
- "gzipped": 40855
+ "bundled": 356054,
+ "minified": 134070,
+ "gzipped": 37695
},
"dist/react-beautiful-dnd.min.js": {
- "bundled": 343989,
- "minified": 130858,
- "gzipped": 36610
+ "bundled": 320016,
+ "minified": 121108,
+ "gzipped": 33429
},
"dist/react-beautiful-dnd.esm.js": {
- "bundled": 180665,
- "minified": 91821,
- "gzipped": 23548,
+ "bundled": 179908,
+ "minified": 90873,
+ "gzipped": 23472,
"treeshaked": {
"rollup": {
- "code": 76262,
- "import_statements": 874
+ "code": 75679,
+ "import_statements": 733
},
"webpack": {
- "code": 78237
+ "code": 77480
}
}
}
}
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.
Here's against master
{
"dist/react-beautiful-dnd.js": {
- "bundled": 400269,
- "minified": 151652,
- "gzipped": 43139
+ "bundled": 356054,
+ "minified": 134070,
+ "gzipped": 37695
},
"dist/react-beautiful-dnd.min.js": {
- "bundled": 358556,
- "minified": 134751,
- "gzipped": 38201
+ "bundled": 320016,
+ "minified": 121108,
+ "gzipped": 33429
},
"dist/react-beautiful-dnd.esm.js": {
- "bundled": 177759,
- "minified": 89807,
- "gzipped": 22649,
+ "bundled": 179908,
+ "minified": 90873,
+ "gzipped": 23472,
"treeshaked": {
- "rollup": 78288,
+ "rollup": {
+ "code": 75679,
+ "import_statements": 733
+ },
- "webpack": 80060
+ "webpack": {
+ "code": 77480
+ }
}
}
}
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.
just so i understand - if a user has no shared deps with the library then they take the 179kb bundle size. If they already have all the deps they get 75kb. Is that correct?
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.
Not quite. Bundled, minified, gzipped are sizes of what we provide in rollup config + terser + gzip.
So in production the library size with dependencies will be 121KB to parse and 33KB to load (minified umd).
If user already have all dependencies then the size will be 90KB to parse and 23KB to load subtract development stuff like process.env.NODE_ENV
(size snapshot provides production replacement only for treeshaked size)
Treeshaked size doesn't make a lot of sense for this library because as you said there is nothing unused.
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.
I think it would be interesting to know what the lowest possible size gzip could be. Ie: if with process.env.NODE_ENV === production and with all dependencies de duplicated.
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.
Don't need to do this here though!
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.
I am still a confused by this:
"treeshaked": {
- "rollup": 78288,
+ "rollup": {
+ "code": 75679,
+ "import_statements": 733
+ },
- "webpack": 80060
+ "webpack": {
+ "code": 77480
+ }
}
And how it relates to the other numbers
"gzipped": 37985 | ||
"bundled": 320016, | ||
"minified": 121108, | ||
"gzipped": 33429 | ||
}, | ||
"dist/react-beautiful-dnd.esm.js": { |
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.
can you please explain the numbers in this section a little bit more? I am a bit confused
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.
treeshaked code means bundle with this entry point import {} from 'library'
which is nothing imported. The result is treeshakability, how much code is left after removing unused code.
import_statements
is how many bytes imports of externals takes in the code
. It's useful when you want to achieve full treeshakability so other libraries could use this one without worrying about user bundle bloat.
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.
Why is the numbers in the tree shaked section bigger than the UMD builds? I would have thought the UMD would be far bigger as it includes the dependencies...?
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.
Treeshaked size is not gzipped. If you will see at minified sizes they are all bigger than treeshaked one.
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.
I see
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.
So without being able to dedupe anything the esm cost is 23472
kb?
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.
Yes + vendors.
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.
Vendors?
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.
23472kb is the size without vendors and without production replacements
Vendors = externals?
…On Fri, 29 Jun 2018 at 8:11 pm, Bogdan Chadkin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In .size-snapshot.json
<#590 (comment)>
:
> },
"dist/react-beautiful-dnd.min.js": {
- "bundled": 353559,
- "minified": 135149,
- "gzipped": 37985
+ "bundled": 320016,
+ "minified": 121108,
+ "gzipped": 33429
},
"dist/react-beautiful-dnd.esm.js": {
23472kb is the size without vendors and without production replacements
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACFN7YuzEilGTfp-mwG6vL3QFRf9vAhDks5uBf1WgaJpZM4U7HBY>
.
|
Yes. Everything in |
So 23kb is just our code. Ie no redux, react motion?
But then how is our UMD build about the same, which I thought had the
dependencies in it
…On Fri, 29 Jun 2018 at 8:35 pm, Bogdan Chadkin ***@***.***> wrote:
Yes. Everything in node_modules
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACFN7WUTimsN56aIcm0t3r4BYSrknab8ks5uBgMHgaJpZM4U7HBY>
.
|
Not the same
|
This is a great win from this PR: "dist/react-beautiful-dnd.min.js": {
- "bundled": 343989,
- "minified": 130858,
- "gzipped": 36610
+ "bundled": 320016,
+ "minified": 121108,
+ "gzipped": 33429
}, 3kb in the gzip for moving to the new babel. niace |
Well done @TrySound !!!! |
Ref #525
esm bundle is slightly increased but as we can see user bundle in the end will be smaller.