babel-plugin-lodash icon indicating copy to clipboard operation
babel-plugin-lodash copied to clipboard

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

Open Pearce-Ropion opened this issue 1 year ago • 12 comments

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.

Pearce-Ropion avatar Mar 11 '23 21:03 Pearce-Ropion

Can we please get some movement on this?

treygrr avatar Mar 16 '23 16:03 treygrr

@munteanuic Do you have the ability to merge this?

Pearce-Ropion avatar Apr 06 '23 15:04 Pearce-Ropion

@Pearce-Ropion i do not

munteanuic avatar Apr 06 '23 15:04 munteanuic

@megawac @jdalton can you please take a look?

afonsojramos avatar Apr 11 '23 00:04 afonsojramos

Any updates on movement here?

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

@megawac @jdalton

aarowman avatar May 08 '23 21:05 aarowman

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

neutraali avatar May 30 '23 12:05 neutraali

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

justtoconfirm avatar Jun 06 '23 13:06 justtoconfirm

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.

Pearce-Ropion avatar Jun 22 '23 20:06 Pearce-Ropion

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.

afonsojramos avatar Jun 22 '23 20:06 afonsojramos

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

wesleybl avatar Jul 19 '23 14:07 wesleybl

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

ridwan-agentpoint-au avatar Jul 26 '23 07:07 ridwan-agentpoint-au

Thank you @Pearce-Ropion!

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

har0ld-scl avatar Aug 07 '23 22:08 har0ld-scl