Skip to content

Rename to @sigmacomputing/babel-plugin-lodash and fix module declaration bug #1

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

Merged
merged 2 commits into from
Jun 22, 2023

Conversation

Pearce-Ropion
Copy link

Fork original lodash/babel-plugin-lodash to @sigmacomputing/babel-plugin-lodash

  • #261 hasn't seen any kind of acknowledgement from the package authors

Resolves #259

The isModuleDeclaration method was recently deprecated in
babel/babel#15266 which causes deprecation notices akin to the following:

Trace: `isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`.
    at isModuleDeclaration (/path/to/example/node_modules/@babel/types/lib/validators/generated/index.js:3939:11)
    at PluginPass.Program (/path/to/example/node_modules/babel-plugin-example/lib/index.js:102:44)
    at newFn (/path/to/example/node_modules/@babel/traverse/lib/visitors.js:148:21)
    at NodePath._call (/path/to/example/node_modules/@babel/traverse/lib/path/context.js:45:20)
    at NodePath.call (/path/to/example/node_modules/@babel/traverse/lib/path/context.js:35:17)
    at NodePath.visit (/path/to/example/node_modules/@babel/traverse/lib/path/context.js:80:31)
    at TraversalContext.visitQueue (/path/to/example/node_modules/@babel/traverse/lib/context.js:86:16)
    at TraversalContext.visitSingle (/path/to/example/node_modules/@babel/traverse/lib/context.js:65:19)
    at TraversalContext.visit (/path/to/example/node_modules/@babel/traverse/lib/context.js:109:19)
    at traverseNode (/path/to/example/node_modules/@babel/traverse/lib/traverse-node.js:18:17)

According to the migration guide, babel plugins are recommended to replace the method with either isImportOrExportDeclaration in the case where backward compatibility is not essential. Or, if backward compatibility is an issue, a combination of isImportDeclaration and isExportDeclaration. This PR applies the latter.

The recommendation mentioned above can be found in the "Migration guide (for plugin authors)" section of babel/babel#15266.

Relates to #260 – I didn't have permission to update that PR and it hasn't had any movement from the PR author for a while.

@Pearce-Ropion Pearce-Ropion merged commit f10433f into master Jun 22, 2023
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.

isModuleDeclaration has been deprecated
1 participant