Skip to content
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

Ship flat bundles instead of a lib folder #1359

Closed
mxstbr opened this issue Dec 16, 2017 · 7 comments · Fixed by #1362
Closed

Ship flat bundles instead of a lib folder #1359

mxstbr opened this issue Dec 16, 2017 · 7 comments · Fixed by #1362

Comments

@mxstbr
Copy link
Member

mxstbr commented Dec 16, 2017

Based on this blogpost by the React core team we should ship flat bundles instead of the lib folder we have right now. Essentially, rather than shipping tons of files we'd only ship two bundles that contain the CommonJS code.

This will make it possible for us to experiment with Google Closure Compiler, ref #1360.

@juristr
Copy link

juristr commented Dec 16, 2017

Nice 👍. The angular team also ships their libs as FESM (Flat ES Modules). Here's the spec they use: https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs

Also gave a talk about it last week: https://youtu.be/K4YMmwxGKjY. Maybe it helps 🙂

@GGAlanSmithee
Copy link
Member

GGAlanSmithee commented Dec 16, 2017

Interesting how the bundle winds are blowing, but the reasons mentioned in the linked article are sound, it was an interesting read. Am I right in that this won't start the es module export at all?

@mxstbr what are you looking for as a first step regarding this?

@mxstbr
Copy link
Member Author

mxstbr commented Dec 16, 2017

I don't know how to start this off to be honest @GGAlanSmithee. I guess a good first step would be to look at Reacts rollup config and figure out the parts that are related to the flat CJS bundles?

We already use rollup to create our .js and .min.js UMD bundles for script tags and the .es.js esm bundle for bundlers to get better treeshaking, so it might not be too.hard to copy those parts and output two more bundles maybe?

@Andarist
Copy link
Contributor

Going to prepare a PR for this.

@mxstbr
Copy link
Member Author

mxstbr commented Dec 17, 2017

Amazing @Andarist, can't wait! 😍

@wardpeet
Copy link

I can work on closure if you like.

@mxstbr
Copy link
Member Author

mxstbr commented Dec 18, 2017

@wardpeet that'd be awesome, please comment in #1360!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants