-
Notifications
You must be signed in to change notification settings - Fork 34
refactor!: migrate to meriyah v7.x #432
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
Conversation
🦋 Changeset detectedLatest commit: 269ea78 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
3ebaf84 to
269ea78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the codebase from meriyah v6.x to v7.0.0, introducing breaking changes in the parsing API. The migration updates parsing function calls, removes deprecated options, and adjusts error handling to align with the new API.
- Updated meriyah dependency to v7.0.0 across all workspaces (tracer, js-x-ray, estree-ast-utils)
- Migrated from
parseScriptwithmoduleoption toparseModule/parsewithsourceTypeoption - Removed the
moduleconfiguration option from AstAnalyser's RuntimeOptions interface - Added non-null assertions in test files to handle potential undefined returns from
getWarning()
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| workspaces/tracer/package.json | Updated meriyah dependency to v7.0.0 |
| workspaces/tracer/test/utils.ts | Migrated to meriyah.parse with sourceType: "module" option |
| workspaces/js-x-ray/package.json | Updated meriyah dependency to v7.0.0 |
| workspaces/js-x-ray/src/JsSourceParser.ts | Refactored to use parseModule by default with fallback to parse using sourceType: "commonjs" for illegal return statements |
| workspaces/js-x-ray/src/AstAnalyser.ts | Removed module option from RuntimeOptions and updated parser invocations |
| workspaces/js-x-ray/test/utils/index.ts | Implemented try-catch fallback from parseModule to parseScript |
| workspaces/js-x-ray/test/probes/isRequire.spec.ts | Added non-null assertions for getWarning() return values |
| workspaces/js-x-ray/test/probes/isImportDeclaration.spec.ts | Added non-null assertion for getWarning() return value |
| workspaces/js-x-ray/test/issues/163-illegalReturnStatement.spec.ts | Simplified test to remove module option |
| workspaces/js-x-ray/test/JsSourceParser.spec.ts | Removed isEcmaScriptModule option from test cases |
| workspaces/js-x-ray/test/AstAnalyser.spec.ts | Removed module option from all test cases |
| workspaces/js-x-ray/docs/AstAnalyser.md | Updated documentation to remove module option |
| workspaces/js-x-ray-ai/package-lock.json | Deleted package-lock.json file |
| workspaces/estree-ast-utils/package.json | Updated meriyah dependency to v7.0.0 |
| workspaces/estree-ast-utils/test/utils.ts | Removed module and globalReturn options from parseScript call |
Files not reviewed (1)
- workspaces/js-x-ray-ai/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.