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

Fix importComponent (v15.x) #2078

Merged
merged 9 commits into from
Feb 16, 2022

Conversation

hops-release-bot[bot]
Copy link

⚠️ This PR is the successor of #2070 and has been created automatically because the previous PR's commits could not be cherry-picked. ⚠️

Please resolve the conflicts and merge this PR afterwards by running the following command:

git fetch origin && \
git fetch origin pull/2070/head && \
git checkout fix-importcomponent-v15.x && \
git reset --hard HEAD^ && \
git cherry-pick 4d9db895be547a0577cd336e29676a5cb836d284 0bcc9999d8e83e824637287eb5af85d5fb041bf0 673a06d04c34444fb5ffefe5fa4cecc02c19a011 9df7b149292b4367e0bed178dbf1cc630887b3b6 dbf793b74ecb88374a1f6b71f5119bb19744682d 32f136ad2c99fec6dd24163097b0bc1575111ec0 e33f6cfb8e1737297c87879ca2b3f3daba4cd7cc 5b5fd4d6f84c17ac6fb917f5fe20ad683de79484 a3e82c869053af02ae8d3277b81e9bc5fe5948be b134446e6727f6325e1de33f80964e09db28ce31

After successfully resolving all conflicts, you need to force-push your changes.

git push --force origin fix-importcomponent-v15.x

Ref: #1632, #1976

Todo:

  • What happens if we import the same file from different files? I suspect our babel plugin will generate different chunk names which should in fact not be different. So maybe our hash should not include the filepath of the importing component but only the filepath of the imported component.
    • seems to create separate entries in the namedChunkGroups which point to the same asset.
Bors merge bot cheat sheet

We are using bors-ng to automate merging of our pull requests. The following table provides a summary of commands that are available to reviewers (members of this repository with push access) and delegates (in case of bors delegate+ or bors delegate=[list]).

Syntax Description
bors merge Run the test suite and push to master if it passes. Short for "reviewed: looks good."
bors merge- Cancel an r+, r=, merge, or merge=
bors try Run the test suite without pushing to master.
bors try- Cancel a try
bors delegate+ Allow the pull request author to merge their changes.
bors delegate=[list] Allow the listed users to r+ this pull request's changes.
bors retry Run the previous command a second time.

This is a short collection of opinionated commands. For a full list of the commands read the bors reference.

@hops-release-bot hops-release-bot bot added the 📦 v15 Apply this label to a pull request, if it has to be cherry-picked to the v15.x-branch after merging. label Feb 16, 2022
@hops-release-bot hops-release-bot bot mentioned this pull request Feb 16, 2022
1 task
ZauberNerd and others added 9 commits February 16, 2022 13:38
We observed that in some cases the generated module ids differe between
the browser and server build.
This happens when one of the builds is able to concatenate modules into
one chunk while the other build can't (e.g. because the modules live in
different chunks because of code splitting).
Because we did not want to split the server build into chunks and then
load them manually, we decided to generate stable chunk names, that do
not differ between browser/server, in our importComponent babel plugin.

We tried to work around this issue previously via #1976 but with a later
webpack version our workaround stopped working.
Furthermore, our previous workaround had other issues, which impacted
tree-shaking and therefore the bundle size.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
Co-authored-by: Robert Kowalski <robert.kowalski@new-work.se>
In case the `--experimental-esbuild` mode is used, we have a small
webpack loader to handle the `importComponent` transformation.
This had been introduced in #1632 to be a quick & dirty regex based
replacer.
With this commit we now have a webpack loader that has a fast-exit
path in case `importComponent` is not used. Otherwise it will transpile
the source code using the proper babel plugin.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
Co-authored-by: Robert Kowalski <robert.kowalski@new-work.se>
Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
Co-authored-by: Robert Kowalski <robert.kowalski@new-work.se>
in the current setup, webpack builds where still running when the
puppeteer tests would start, which leads to timeout issues,
especially on slow machines like CI servers.

This commit waits for the build to finish before continuing with
`getUrl`, which is called by the integration tests upfront

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
Co-authored-by: Robert Kowalski <robert.kowalski@new-work.se>
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
@ZauberNerd ZauberNerd force-pushed the fix-importcomponent-v15.x branch from 12f7787 to cbc5ba1 Compare February 16, 2022 13:41
@ZauberNerd ZauberNerd marked this pull request as ready for review February 16, 2022 13:42
@ZauberNerd ZauberNerd merged commit e69c70f into release-bot/next-v15.x Feb 16, 2022
@ZauberNerd ZauberNerd deleted the fix-importcomponent-v15.x branch February 16, 2022 13:54
@hops-release-bot hops-release-bot bot mentioned this pull request Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 v15 Apply this label to a pull request, if it has to be cherry-picked to the v15.x-branch after merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants