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

🏗🚮 Clean up amphtml root-level dependencies #33115

Merged
merged 2 commits into from Mar 8, 2021
Merged

🏗🚮 Clean up amphtml root-level dependencies #33115

merged 2 commits into from Mar 8, 2021

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Mar 6, 2021

PR highlights:

  • Removed these from dependencies:
    • open: This should have been in devDependencies
    • prop-types: Now installed on-demand by third_party/react-dates/ (not imported by runtime)
  • Removed these from devDependencies:
    • 0x: Not used, cleaned up
    • derequire: Now installed on-demand by third_party/react-dates/
    • envify: Now installed on-demand by third_party/react-dates/
    • pretty-bytes: Not used, cleaned up
    • react-addons-shallow-compare: Now installed on-demand by third_party/react-dates/
    • react-externs: Now installed on-demand by third_party/react-dates/
    • react-with-direction: Now installed on-demand by third_party/react-dates/
    • renovate: Replaced by a direct call to npx (this gets updated almost daily and shouldn't have been installed)
    • uglifyify: Now installed on-demand by third_party/react-dates/
    • vinyl-sourcemaps-apply: Not used, cleaned up
    • watchify: Not used, cleaned up
  • Added these to devDependencies:
    • events: Used but missing
    • open: Moved from dependencies
    • @babel/plugin-transform-classes: Used but missing
  • Fixed incorrect usage of non-dependencies that just happened to be installed transitively

This results in a 33% reduction in node_modules size (~750 MB → ~500 MB) and npm ci duration (~30s → ~20s).

@rsimha
Copy link
Contributor Author

rsimha commented Mar 6, 2021

@jridgewell @samouri The babel plugin tests are failing while loading a non-existent plugin babel-plugin-external-helpers (that was never installed to start with). Perhaps there's a hard-coded path to a transitive dependency that has now gone away? Wanna take a peek in case you can spot what's going on?

@jridgewell
Copy link
Contributor

The babel plugin tests are failing while loading a non-existent plugin babel-plugin-external-helpers (that was never installed to start with).

Babel just added this requirement to tests: babel/babel#12911. We'd need to update our options.json files to include "externalHelpers": false, or keep babel-plugin-external-helpers in our dev dependencies.

@jridgewell
Copy link
Contributor

I opened babel/babel#12982 to make babel-plugin-external-helpers optional in tests.

@rsimha
Copy link
Contributor Author

rsimha commented Mar 8, 2021

Babel just added this requirement to tests: babel/babel#12911. We'd need to update our options.json files to include "externalHelpers": false, or keep babel-plugin-external-helpers in our dev dependencies.

I opened babel/babel#12982 to make babel-plugin-external-helpers optional in tests.

Thanks for the fix! In the meantime, instead of editing 100+ options.json files, I've added a temporary version resolution to pin @babel/helper-transform-fixture-test-runner to v7.12.13. We can remove it after your fix lands and a new version of @babel is released.

Edit: Fix merged with #33145, temporary resolution removed.

@rsimha rsimha merged commit 24e3d1b into ampproject:master Mar 8, 2021
@rsimha rsimha deleted the 2021-03-05-CleanUpDeps branch March 8, 2021 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants