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

Build: upgrade mini-css-extract-plugin-with-rtl to npm-published a8c fork #38001

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

jsnajdr
Copy link
Member

@jsnajdr jsnajdr commented Nov 27, 2019

Updated the mini-css-extract-plugin-with-rtl package as follows:

Then I updated the calypso-build package to use the npm-published package.

Because version 0.8.0 introduced a new ignoreOrder option that allows to disable the conflicting order warnings, we no longer need to disable them ourselves with webpack-filter-warnings-plugin and can remove that code and the filter-warnings plugin, too, as this was its only usage.

Then I also updated the lockfiles of apps/full-site-editing and apps/wpcom-block-editor. full-site-editing referenced npm-published @automattic/calypso-build, so I changed that to a file: reference: makes more sense for monorepo.

How to test:
Build and run Calypso with ?flags=quick-language-switcher. Verify that when switching between LTR and RTL languages, the CSS chunks are switched at runtime.

@jsnajdr jsnajdr added the Build label Nov 27, 2019
@jsnajdr jsnajdr requested review from ockham, sirreal and a team November 27, 2019 12:30
@jsnajdr jsnajdr requested review from a team as code owners November 27, 2019 12:30
@jsnajdr jsnajdr self-assigned this Nov 27, 2019
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Nov 27, 2019

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@jsnajdr jsnajdr force-pushed the upgrade/mini-css-extract-plugin-with-rtl branch 3 times, most recently from 91658e3 to 71529a2 Compare December 4, 2019 12:02
@jsnajdr
Copy link
Member Author

jsnajdr commented Dec 4, 2019

@blowery I'm unable to update the apps/full-site-editing and apps/wpcom-block-editor lockfiles, no matter what I do.

Even if I remove the root node_modules and try to npm i in apps/full-site-editing from clean slate (no node_modules and package-lock.json), I get to a broken state.

  • npm i succeeds and produces a local node_modules and package-lock.json
  • it also produces a packages/calypso-build/node_modules directory
  • when I run npm ci after this, it fails with @automattic/mini-css-extract-plugin-with-rtl not accessible from @automattic/calypso-build

It seems that referencing packages outside the current NPM root, e.g., file:../../packages/calypso-build, fails to treat all these directories as one tree and produce a valid package-lock.json.

Apparently, you were able to produce valid lockfiles in one of earlier version of this PR. How did you do that? 🙂

@jsnajdr
Copy link
Member Author

jsnajdr commented Dec 4, 2019

The version of this patch currently in this branch has all the package-lock.json files removed. So that it's easier to experiment and rebase.

That's also why the CI tasks completely fail.

@blowery
Copy link
Contributor

blowery commented Dec 4, 2019

@jsnajdr here's some things to try:

# start from the root of calypso
npm run distclean;
cd apps/full-site-editing;
npm i;
# take a peek at the diff, stage the change
git add package-lock.json
npm ci; # this worked for me...
npm i; # you'd expect this to be a no-op... but...
git diff; # it wasn't for me
npm ci; #still worked, but different lock

@jsnajdr
Copy link
Member Author

jsnajdr commented Dec 4, 2019

npm ci; # this worked for me...

This is the step where I'm failing. An important point is that I changed the reference to @automattic/calypso-build in apps/full-site-editing/package.json from npm reference (version number, downloaded the package from npm) to a file:../../packages/... reference.

Then the lockfile doesn't contain any calypso-build dependencies, probably because they are installed into packages/calypso-build/node_modules, which is outside the apps/full-site-editing subtree. I assume that npm dedupe and the lockfile generation code has some issue with that.

@blowery
Copy link
Contributor

blowery commented Dec 4, 2019

What version of npm? Does npm@latest behave any differently?

@jsnajdr
Copy link
Member Author

jsnajdr commented Dec 4, 2019

I'm on npm 6.9.0, the one that ships with the current Node LTS. Nothing special.

@blowery blowery force-pushed the upgrade/mini-css-extract-plugin-with-rtl branch from 71529a2 to ebd05c2 Compare December 5, 2019 19:25
@blowery
Copy link
Contributor

blowery commented Dec 5, 2019

@jsnajdr redid the locks here with npm@6.13.2 and had to run npm i twice in the root to get the right bits to appear in the root lockfile.

@jsnajdr jsnajdr force-pushed the upgrade/mini-css-extract-plugin-with-rtl branch from ebd05c2 to 72259e8 Compare January 16, 2020 13:07
@jsnajdr
Copy link
Member Author

jsnajdr commented Jan 16, 2020

@blowery after rebasing on top of #38190, this upgrade becomes trivial 👍 Please 👀

Copy link
Contributor

@blowery blowery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested out well.

@jsnajdr jsnajdr merged commit 4116cc9 into master Jan 17, 2020
@jsnajdr jsnajdr deleted the upgrade/mini-css-extract-plugin-with-rtl branch January 17, 2020 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants