Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

[fix]Migrate deprecated isModuleDeclaration method to recommended replacements #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pearce-Ropion
Copy link

@Pearce-Ropion Pearce-Ropion commented Mar 11, 2023

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.

@treygrr
Copy link

treygrr commented Mar 16, 2023

Can we please get some movement on this?

@Pearce-Ropion
Copy link
Author

@munteanuic Do you have the ability to merge this?

@munteanuic
Copy link

@Pearce-Ropion i do not

@afonsojramos
Copy link

@megawac @jdalton can you please take a look?

@aarowman
Copy link

aarowman commented May 8, 2023

Any updates on movement here?

@munteanuic you approved the changes nearly 2 months ago - what is the next step?

@megawac @jdalton

@neutraali
Copy link

Probably easier to just make a separate fork at this point. Project seems unresponsive.

@justtoconfirm
Copy link

As mentioned in previous comments, is this expected to be approved and merged at all?

@Pearce-Ropion
Copy link
Author

For anyone following this thread, I've just published @sigmacomputing/babel-plugin-lodash (npm) (github) which has this fix applied.

It can be used the same way, but requires switching out instances of babel-plugin-lodash with @sigmacomputing/babel-plugin-lodash in your babel config files.

I don't really plan on taking over maintenance of this project, but my team was getting frustrated enough with this warning to take the time to get the fix up.

@afonsojramos
Copy link

Thank you so much @Pearce-Ropion!

Let's try one final tag to the whole team: @lodash @veksen @falsyvalues @zackhall @bnjmnt4n @mathiasbynens @jdalton

The organisation should have more people with maintainer level access honestly.

@wesleybl
Copy link

@jdalton can you please take a look here? Maybe add @Pearce-Ropion to the repository?

@ridwan-agentpoint-au
Copy link

ridwan-agentpoint-au commented Jul 26, 2023

@wesleybl i already mention him @jdalton in twitter, but the creator still didnt replay yet

@har0ld-scl
Copy link

Thank you @Pearce-Ropion!

I'll be using your publication instead because of the delay merging this pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

isModuleDeclaration has been deprecated