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

Use preact and preact-router from source instead of dist #636

Open
prateekbh opened this issue Sep 7, 2018 · 9 comments
Open

Use preact and preact-router from source instead of dist #636

prateekbh opened this issue Sep 7, 2018 · 9 comments

Comments

@prateekbh
Copy link
Member

prateekbh commented Sep 7, 2018

Do you want to request a feature or report a bug?
Bug

What is the current behaviour?
We use preact and preact-router from their dist folder on npm

What is the expected behaviour?
Since we transpile node_modules ourselves we should be using preact and preact_router from their source. This will have no affect on the regular bundles but will have some saving on the module bundle generated.

If this is a feature request, what is motivation or use case for changing the behaviour?
Web perf

Please mention other relevant information.

  • Node version: any
  • npm version: any
  • Operating system: any
  • CLI version: next
  • Browser: any
@prateekbh prateekbh added this to To do in Preact-cli 3.0 Sep 7, 2018
@prateekbh prateekbh added this to the 3.0 milestone Sep 7, 2018
@lukeed
Copy link
Member

lukeed commented Sep 7, 2018

Thumbs down

@prateekbh
Copy link
Member Author

no? because?

@lukeed
Copy link
Member

lukeed commented Sep 7, 2018

Preact & Router are super optimized distributions. No user-settings are going to match it. /cc @developit

@prateekbh
Copy link
Member Author

Now thats a thing I never knew, super interested in learning what is it?

@lukeed
Copy link
Member

lukeed commented Sep 7, 2018

Follow here. IIRC it's circa ~1kb savings. This is actually (can) happen often, and is part of the reason why bundling from node_modules is not the norm... for now.

@prateekbh
Copy link
Member Author

prateekbh commented Sep 7, 2018

feel free to close :), if there's no better solution

@kristoferbaxter
Copy link

@developit We spoke about moving the optimizations to build size into preact-cli and applying these across all source instead of just one off packages.

Perhaps now is the time, or 3.1.0.

@lukeed
Copy link
Member

lukeed commented Sep 7, 2018

I'd support that 👍 It was a thumbs-down for present situation.

My original intention for CLI was to extract some of the config into standalone chunks. I finally got around to the Babel stuff (#639), but an uglify package was on my radar too. Perhaps the mapping lives there?

@developit
Copy link
Member

Another thing we can consider here is applying the Preact's minification processes to a bundled JS Modules version - with constant inlining, hoisting and a customized terser config I'm sure it'd be reasonably close to what preact ships over the wire today.

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

No branches or pull requests

5 participants