-
Notifications
You must be signed in to change notification settings - Fork 693
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
First attempt at adopting Parcel #1186
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
9b3ed70
Upgrade sharp
captbaritone 16e6ff3
First attempt at adopting Parcel
captbaritone fc20c7b
Get multiple targets working for Parcel
captbaritone 72124c6
Use lts node for Netlify deploy
captbaritone 70af734
Update deploy script to reflect new demo site dir
captbaritone fe98ed2
Inline css into library bundles
captbaritone c5bc16e
More updates
captbaritone a916afa
Remove uri optimization
captbaritone cb24615
Upgrade parcel
captbaritone 4aff8fa
Fix butterchurn logo import for Parcel
captbaritone 5bb82df
Add browser build
captbaritone b42ee3d
List browser build
captbaritone 55dadd1
Prefer jest-swc to babel
captbaritone f4fbd80
Preserve old build artifact location
captbaritone b5a5e0b
Ignore dist
captbaritone cb3ee6b
Minify library bundles
captbaritone f9f6990
Switch to postcss to use uri optimization plugin
captbaritone 47d815a
Serve from the correct location
captbaritone a285465
Clarifying comments
captbaritone 7c935b9
Ignore bundle reports in git
captbaritone 3c3bdb0
Refine Parcel builds
captbaritone 88c36ba
Try to be more explicit with port
captbaritone 281b10c
Use relative path to create build dir
captbaritone 46a809b
Try to force supporting chrome 76
captbaritone c9a8651
Update the location of the test skin in integration test to work with…
captbaritone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
node_modules | ||
.vscode | ||
.vscode | ||
.parcel-cache | ||
dist | ||
parcel-bundle-reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@parcel/config-default" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Where did all of these changes come from?
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.
If there is some import to a Node builtin modul (e.g.
stream
), Parcel autoinstalls the corresponding polyfill.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.
(And same goes for the two Parcel plugins listed in here, which are installed on demand. And in this case, you forgot the bump them when upgrading to
"parcel": "^2.8.2"
)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.
Oh awesome! I assumed it was something like this, thanks for commenting.
BTW, shipping this is currently blocked on some significant size regressions. Webamp lazy is the simpler case to debug since it doesn't pull in some of the heavy dependencies like JSZip.
Using the bundle analyzer reporter gives a nice looking report, but it's dominated by "code from unknown sources". So my next step is to try to figure out what's contributing to this regression.
https://enchanting-khapse-0a90c1.netlify.app/webamp-lazy.html
If you happen to have any tips on how to diagnose, that'd be super helpful!
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.
"isLibrary": true
makes the default"optimize": false
, because you usually don't want published libraries to be minified. But you can override that of course (I assume you want minification as they're called*.min.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.
Okay. It looks like the remaining difference for the lazy version is entirely attributable to the fact that I haven't yet ported my image optimization to Parcel.
I tried manually checking the optimized version of the CSS into the repo and we are now at ~3% reduction in bundle size!
Reading the Parcel docs it implies that png images are automatically optimized. It looks like that does not apply to png images that exist as data uris in CSS files (that's what my custom Webpack loader does). Is that an optimization that Parcel could/should apply? It seems in keeping with Parcel's approach of automatically applying optimizations where it can, but I also get that this is quite an edge case.
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.
🎉
Yeah, but it should be possible to support in Parcel.
An alternative here (and this might even be preferable just from a code authoring perspective) is putting these inline PNGs into separate files and then using Parcel's feature to inline it as a data-url: https://parceljs.org/features/bundle-inlining/#inlining-as-a-data-url
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.
Yeah, I think a "normal" app would work this way, but Webamp has built in support for loading custom "skins", which means it converts the zip file into CSS (with embedded data uris) in the browser. The way I generate the default skin CSS file is I load the custom skin and copy out the generated CSS. This means there's not a reasonable way to get those (probably hundreds) of png files as actual files on the file system.
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.
As you saw, I raised the issue on the Parcel repo: parcel-bundler/parcel#8758 (comment)
I'll probably just keep my existing setup unless that feature looks appealing to someone to implement.
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'll see if I can fix that parcel issue you mentioned -- I'll recomment here if I get to it.