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(estree-walker): bump estree-walker to v3 #1786

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bashmish
Copy link

@bashmish bashmish commented Oct 14, 2024

Rollup Plugin Name: commonjs, dynamic-import-vars, inject, pluginutils, strip

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers: none

Description

  • estree-walker has been updated to v3 which is an ESM package
  • I'm using v3, it works best with my TypeScript setup with ESM everywhere and JSDoc syntax for types
  • the goal here is to update it across all tooling and minimize dependecies/duplicates

@bashmish bashmish requested a review from shellscape as a code owner October 14, 2024 09:57
@@ -5774,6 +5780,8 @@ snapshots:

'@types/[email protected]': {}

'@types/[email protected]': {}
Copy link
Author

@bashmish bashmish Oct 14, 2024

Choose a reason for hiding this comment

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

I see some of these can be dedupe, but I only know one way which is to run pnpm dedupe, but it gives lots of other unrelated changes too, so probably best do it centrally and not in this PR

let me know if there is a better way, happy to learn how to use pnpm in such cases

@shellscape
Copy link
Collaborator

Thanks for the PR. Looks like this change set causes issues with CI. Please have a look.

@bashmish
Copy link
Author

bashmish commented Oct 21, 2024

This is puzzling me. I tried this locally in different ways, not only with pnpm install --frozen-lockfile, but also separately for the package in question, all works fine.

I also used the same pnpm as in the Actions npm i -g [email protected], no luck.

Looks like @types/estree dependency is not deduped optimally and hence I tried to fix manually the lock file, but I can't test this locally, I mean it works before and after. And running the build here requires a manual approve, so my test loop is very long (last time it was a day), not sure how to proceed, just hope it works this time in Actions.

@bashmish
Copy link
Author

I figured pnpm --recursive build gives this error. Can test locally now 🎉

@@ -66,7 +66,7 @@ export function dataToEsm(data: unknown, options?: DataToEsmOptions): string;
* Extracts the names of all assignment targets based upon specified patterns.
* @param param An `acorn` AST Node.
*/
export function extractAssignedNames(param: BaseNode): string[];
Copy link
Author

@bashmish bashmish Oct 21, 2024

Choose a reason for hiding this comment

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

this fixes

packages/node-resolve prepare: created ./dist/cjs/index.js, ./dist/es/index.js in 3s
packages/pluginutils prepare: [!] (plugin typescript) Error: @rollup/plugin-typescript TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
packages/pluginutils prepare:   Property 'id' is missing in type 'BaseNode' but required in type 'VariableDeclarator'.
packages/pluginutils prepare: src/attachScopes.ts (64:8)
packages/pluginutils prepare: 
packages/pluginutils prepare: 64   walk(ast, {
packages/pluginutils prepare:           ~~~
packages/pluginutils prepare:   ../../node_modules/.pnpm/@[email protected]/node_modules/@types/estree/index.d.ts:[255](https://github.com/rollup/plugins/actions/runs/11325212724/job/31590538305#step:9:256):5
packages/pluginutils prepare:     255     id: Pattern;
packages/pluginutils prepare:             ~~
packages/pluginutils prepare:     'id' is declared here.

changes between BaseNode to Node seems to have a bit of history here
I saw a few issues and PRs addressing them, seemed like a back and forth

given recent change in Rich-Harris/estree-walker#34 that fixes Rich-Harris/estree-walker#28, using Node seems to be the way, at least from the walker perspective

hope it's OK also for pluginutils

@bashmish bashmish marked this pull request as draft October 23, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants