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

Esm builds #583

Merged
merged 12 commits into from Jul 9, 2018
Merged

Esm builds #583

merged 12 commits into from Jul 9, 2018

Conversation

@prateekbh
Copy link
Member

prateekbh commented Jun 1, 2018

What kind of change does this PR introduce?
Introduces babel7 and build mirrored es6 bundles for eeverything. Ships es6 with <script type=module

Did you add tests for your changes?
No, The snapshot thing is flaky with the babel-esm-plugin.

Summary

This is part 1 of 2 PRs to come which will put a new flag(--esm) in preact build. This will ship es6 and es5 code both using module/nomodule.

There will be followup PRs to compliment the functionality in SW

Does this PR introduce a breaking change?
No.

Other information
Spiderman dies in Avengers infinity war. #Sorry

new BabelEsmPlugin({
filename: '[name].esm.js',
chunkFilename: '[name].esm.js'
}),

This comment has been minimized.

@ForsakenHarmony

ForsakenHarmony Jun 1, 2018 Member

should be tabs here I think

@ForsakenHarmony
Copy link
Member

ForsakenHarmony commented Jun 1, 2018

very nice

do you think we need a flag? I think we could have it as default with opt out myb

@prateekbh
Copy link
Member Author

prateekbh commented Jun 1, 2018

About the flag... This experiment is so new that there definitely should be a way to turn it off... So may be a flag with default on

@reznord
Copy link
Member

reznord commented Jun 1, 2018

+1 for the --esm flag on preact build command.

We can leave it off by default and we can enable it by the --esm flag (just my thoughts)

.option('--json', 'Generate build stats for bundle analysis')
.option('--template', 'Path to custom HTML template')
.option('--analyze', 'Launch interactive Analyzer to inspect production bundle(s)')
.option('--prerenderUrls', 'Path to pre-rendered routes config', 'prerender-urls.json')
.option('-c, --config', 'Path to custom CLI config', 'preact.config.js')
.option('-c, --config', 'Path to custom CLI config', 'preact.config.js')
.option('--esm', '[HIGHLY EXPERIMENTAL] Builds ES-2015 bundles for your code.', 'esm')

This comment has been minimized.

@ForsakenHarmony

ForsakenHarmony Jun 6, 2018 Member

spaces instead of tabs again 👀

This comment has been minimized.

@prateekbh

prateekbh Jun 6, 2018 Author Member

Yeah I'll fix my editor... 😑.

"babel-plugin-transform-react-remove-prop-types": "^0.4.5",
"babel-preset-env": "^1.3.3",

This comment has been minimized.

@reznord

reznord Jun 8, 2018 Member

Isn't this required? Preact build command fails at the moment

This comment has been minimized.

@ForsakenHarmony

ForsakenHarmony Jun 8, 2018 Member

look up a couple of lines, has to be changed in the babel config though

This comment has been minimized.

@prateekbh

prateekbh Jun 8, 2018 Author Member

oh yeah...

prateekbh added 5 commits Jun 8, 2018
@prateekbh prateekbh force-pushed the esm-builds branch from b75bd57 to e7b5f06 Jun 15, 2018
@prateekbh prateekbh changed the title [WIP] Esm builds Esm builds Jun 16, 2018
prateekbh added 2 commits Jun 23, 2018
@prateekbh
Copy link
Member Author

prateekbh commented Jun 27, 2018

Requesting a round of review... Tested, Works fine for me.

@ForsakenHarmony ForsakenHarmony merged commit 383d070 into next Jul 9, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@prateekbh prateekbh deleted the esm-builds branch Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.