-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Multiple css bundles in Entry bundle groups issue #9023
Conversation
…of bundlegroups, revert test cases
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
{name: 'entry.css', type: 'css', assets: ['foo.css', 'main.css']}, | ||
]); | ||
}); | ||
it.skip('create a new css bundle to maintain one css bundle per bundlegroup constraint', async () => { |
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.
skipped?
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 forgot about this... okay yes so I still do have one more question. The current solution works with our existing test cases and fixes the cases in the mentioned issue. However, I added this case as an alternative and I'm not sure what our best move is. No one has encountered this to my knowledge yet.
In this test case, we have 1 entry (entry.js
) with two async js
siblings, with which it shared two other .css
files (main
and foo.css
)
Both foo.css
(3) and main.css
(2) have needsStableName: true
but have no subset or perfect overlap in terms of bundleGroups. Should we over-fetch and merge them anyway or should we create a new bundle with duplicated just for entry.js
?
AFAIK old bundler just inefficiently merged them.
cc: @devongovett
I ran into this one again today with another codebase. Seems like maybe we should move forward with the fix even though we don't have a great solution to the |
@AGawrys I was testing out this patch today and noticed that |
Darn. Tested this patch out on our codebase and I'm at least getting a slightly more helpful error message :)
I'll dig into it more next week. |
Any updates on this? :-/ |
Sorry forgot to circle back on this. Unfortunately that patch didn't fix the issue so I'm still hunting for a proper fix. |
It seems to be a very hard bug. Thank you anyway for your efforts. I think you would help many people who want to update from Parcel 1 to Parcel 2 but can't because of this bug, including me. I also notice that using Parcel 1 is slowly becoming a problem. This can't go on for long and I don't want to switch to Vite or anything else because I really like Parcel. I hope a solution can be found! Thank you! |
@jondlm @TobiasSchikora So sorry that this has been such a pain for you. I updated the branch, removing the extra bitSet import seemed to work for me. @jondlm In this PR there is a scenario I wasn't sure how to cover, it could be what you're running into? i.e. A new scenario with the same symptom. Do you have a public repro or minimal repro I could take a look at so I could confirm? I can work to expand this fix if my hunch is correct. In the meantime I'll try to get this merged today. |
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.
@jondlm |
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.
Sure thing!
Oh. I don't have write access to the repo so my review probably doesn't count :( |
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.
There you go 😄
WOW, that's really great news. I can't wait to try it out! Thank you very much! 🧡 |
OK, I have now installed the latest Nightly (
Does anyone know what to do there? Thanks for any help! |
* upstream/v2: (22 commits) Add source map support to the inline-require optimizer (#9511) [Web Extension] Add content script world property to manifest schema validation (#9510) feat: add getCurrentPackageManager (#9505) Default Bundler Contributor Notes (#9488) rename parentAsset to root for msb config and remove unstable (#9486) Macro errors -> v2 (#9501) Statically evaluate constants referenced by macros (#9487) Multiple css bundles in Entry bundle groups issue (#9023) Fix macro issues (#9485) Bump follow-redirects from 1.14.7 to 1.15.4 (#9475) Revert more CI changes to centos job (#9472) Use lightningcss to implement CSS packager (#8492) Fixup CI again (#9471) Clippy and use napi's Either3 (#9047) Upgrade to eslint 8 (#8580) Add support for JS macros (#9299) Fixup REPL CI (#9467) Drop per-pipeline transformation cache (#9459) Upgrade some CI actions (#9466) REPL (#9365) ...
↪️ Pull Request
This PR aims to fix #8813 , or, the issue of having multiple css/ type change bundles in one entry bundlegroup. Currently we only merge if those bundles share the same bundleGroups, this isn't perfect because it may result in sibling type change bundles within one bundlegroup.
The solution below duplicates assets of the "offending" bundle in favor of maintaining the "1 type change bundle per bundlegroup" rule, and does so based on the overlap of bundleGroups.
This changes the current behavior in a non-significant way, so I have a couple questions about if this change is okay, specifically for the affected test cases.Update Tests now align with v2 as we don't merge or duplicate assets if not
needsStableName
💻 Examples & Questions
Here are the graphs of the reproduction from issue #8813:
Before:
AssertionError [ERR_ASSERTION]: Bundle group cannot have more than one entry bundle of the same type
After:
✔️ PR Todo
Update:
Only merging in the case of,
needsStableName
bundles, and only duplicatingcss
assets iff they cannot be merged.Affected Test cases have been reverted since they no longer meet the conditions of
needsStableName
for merging