Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Doesn't work with "modern" transpilation #10

Open
marcins opened this issue Feb 27, 2020 · 1 comment
Open

Doesn't work with "modern" transpilation #10

marcins opened this issue Feb 27, 2020 · 1 comment

Comments

@marcins
Copy link

marcins commented Feb 27, 2020

I am building my code using @babel/preset-modules, this plugin fails to parse on default exports without a class name when they're not being transformed by Babel. That is, components that look like this:

export default class extends Component {}

I looked at adding some failing tests and fixing the plugin but it looks like it hasn't been updated for awhile and is still based on Babel 6, so would likely require some maintenance as well.

If it were up to me, I would probably:

  • update the test suite to build both modern and ES2015 code in the tests
  • maybe move to Jest in order to take advantage of snapshots?
  • update the plugin for Babel 7

Happy to help with a PR if there's appetite for this change.

@tmcneal
Copy link

tmcneal commented Dec 2, 2021

Hi @marcins, I wrote a Webpack plugin that will detect React components defined in this way and emit a displayName property. You can find it here: https://github.com/runreflect/webpack-react-component-name

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

No branches or pull requests

2 participants