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

Example build sadly doesn't work with new --experimental-scope-hoisting flag of parcel-bundler v1.9.x #1

Open
layflags opened this issue Jun 17, 2018 · 6 comments

Comments

@layflags
Copy link

First off, this example's build works perfectly fine without the new --experimental-scope-hoisting flag of @parcel-bundler.

But when turned on via changing the build task to:

  ...
  "build": "parcel build src/index.html --public-url / --experimental-scope-hoisting && cp ./_redirects ./dist/_redirects"
  ...

and starting a local server with e.g. npx http-server dist -p 1337,
I'm getting a console error (Chrome 67, macOS High Sierra):

Uncaught ReferenceError: $28$export$createRouteBundle is not defined
    at src.9b3745b6.js:1
    at src.9b3745b6.js:1

@HenrikJoreteg I know this is probably not an issue with this example or with redux-bundler itself. But maybe you have an idea why it fails or know some guys from @parcel-bundler who are interested.

BTW:

  • JS bundle size w/o flag set: 48.77 KB
  • JS bundle size w/ flag set: 18.11 KB 😮 🚀
@HenrikJoreteg
Copy link
Owner

@layflags i hadn't tried it on this repo yet, but I ran into something similar when trying the flag on another app.

It appears there are some bugs to be ironed out in parcel: https://github.com/parcel-bundler/parcel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+hoisting

@HenrikJoreteg
Copy link
Owner

and wow... that file size difference!

@layflags
Copy link
Author

@HenrikJoreteg Thx for referencing this issue! ... And thx for open sourcing redux-bundler, which is the most pragmatic and elegant way of using redux I've seen so far. 👍 ❤️

@devongovett
Copy link

FYI, I just tested this with the latest Parcel release (1.11.0), and it worked perfectly with scope hoisting turned on. 🎉

@HenrikJoreteg
Copy link
Owner

That's awesome, thanks for the update @devongovett as you know I'm a huge fan of parcel. Thanks for sharing it with us! 😁

@layflags
Copy link
Author

layflags commented Mar 6, 2019

Thx @devongovett for fixing this issue 👍

Stats with parcel@1.11.0:

  • JS bundle size w/o flag set: ~50 KB
  • JS bundle size w/ flag set: ~43 KB

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

No branches or pull requests

3 participants