lodash / babel-plugin-lodash

Modular Lodash builds without the hassle.
Other
1.96k stars 91 forks source link

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

Open Pearce-Ropion opened 1 year ago

Pearce-Ropion commented 1 year ago

Resolves #259

The isModuleDeclaration method was recently deprecated in https://github.com/babel/babel/pull/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 https://github.com/babel/babel/pull/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 commented 1 year ago

Can we please get some movement on this?

Pearce-Ropion commented 1 year ago

@munteanuic Do you have the ability to merge this?

munteanuic commented 1 year ago

@Pearce-Ropion i do not

afonsojramos commented 1 year ago

@megawac @jdalton can you please take a look?

aarowman commented 1 year ago

Any updates on movement here?

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

@megawac @jdalton

neutraali commented 1 year ago

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

justtoconfirm commented 1 year ago

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

Pearce-Ropion commented 1 year ago

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 commented 1 year ago

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 commented 11 months ago

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

ridwan-agentpoint-au commented 11 months ago

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

har0ld-scl commented 11 months ago

Thank you @Pearce-Ropion!

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