Skip to content

Fix e2e-old-babel test to always use old core/helpers/traverse#14794

Merged
nicolo-ribaudo merged 7 commits intobabel:mainfrom
liuxingbaoyu:fix-e2e-old-babel
Jun 29, 2023
Merged

Fix e2e-old-babel test to always use old core/helpers/traverse#14794
nicolo-ribaudo merged 7 commits intobabel:mainfrom
liuxingbaoyu:fix-e2e-old-babel

Conversation

@liuxingbaoyu
Copy link
Copy Markdown
Member

@liuxingbaoyu liuxingbaoyu commented Jul 24, 2022

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@liuxingbaoyu
Copy link
Copy Markdown
Member Author

liuxingbaoyu commented Jul 24, 2022

image

resolutions doesn't seem to work.

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Jul 24, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/54724/

@nicolo-ribaudo
Copy link
Copy Markdown
Member

The gulpfile updates in #14793 should fix this!

@liuxingbaoyu
Copy link
Copy Markdown
Member Author

That's great!
Are the current tests working as expected?
It looks like @babel/traverse which @babel/core depends on should also be pinned to 7.0.0.
When I changed I got a new error, ReferenceError: Unknown helper classStaticPrivateFieldSpecGet, I don't know how to fix this kind of error.

@nicolo-ribaudo
Copy link
Copy Markdown
Member

Yeah, we currently only pin some packages to simulate "bad" user configurations, where they may have an old @babel/core version but its deps are free to change versions.

@liuxingbaoyu
Copy link
Copy Markdown
Member Author

(
  # Yarn prints colors on GH actions even if it's piped, unless explicitly disabled
  # https://github.com/yarnpkg/berry/pull/659
  YARN_ENABLE_COLORS=0 yarn why @babel/core | grep -o "@babel/core@npm:.* (via npm:.*)";
  YARN_ENABLE_COLORS=0 yarn why @babel/helpers | grep -o "@babel/helpers@npm:.* (via npm:.*)";
  YARN_ENABLE_COLORS=0 yarn why @babel/traverse | grep -o "@babel/traverse@npm:.* (via npm:.*)"
) | uniq | node -e "
  var pkg = require('./package.json');
  var packages = fs.readFileSync(0, 'utf8').trim().split('\n');
  pkg.devDependencies['@babel/core'] = '7.0.0';
  packages.forEach(desc => {
    const { name, specifier } = desc
      .match(/(?<name>@babel\/[a-z]+).*\(via (?<specifier>npm:[^)]+)\)/)
      .groups;
    pkg.resolutions[name + '@' + specifier] = '7.0.0';
  });
  fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
"

But our current script also seems to be pinning both @babel/helpers and @babel/traverse.😕
Like the screenshot in #14794 (comment), they were added to resolutions, just didn't work for some reason.

@nicolo-ribaudo nicolo-ribaudo changed the title WIP: fix e2e-old-babel Fix e2e-old-babel test to actually use old core/helpers/traverse Jun 29, 2023
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review June 29, 2023 10:43
@nicolo-ribaudo nicolo-ribaudo changed the title Fix e2e-old-babel test to actually use old core/helpers/traverse Fix e2e-old-babel test to always use old core/helpers/traverse Jun 29, 2023
@nicolo-ribaudo nicolo-ribaudo merged commit cc110c6 into babel:main Jun 29, 2023
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants