DimiMikadze / create-react-library

React NPM library starter kit based on Facebook's create react app
MIT License
602 stars 60 forks source link

add support for legacy decorators #16

Closed jason-henriksen closed 6 years ago

jason-henriksen commented 6 years ago

The fact that babel doesn't continue to support decorators breaks my brain. I'd like to use mobx with decorators inside my component, but I haven't been able to find library creation code that supports it.
( I can create-react-app with custom-react-scripts to get mobx support easily. )

How hard would it be to get this project to include the babel-plugin-transform-decorators-legacy project? I've tried to do it on my own projects but my babel-webpack-fu is not strong enough.

DimiMikadze commented 6 years ago

Hi @jason-henriksen

If create-react-app is not supporting it, we are also not going to support it on master branch, because we share same philosophy.

But we can create separate branch for it.

To answer your question how hard it would be to include babel-plugin-transform-decorators-legacy, i don't know because i've never used it so far.

jason-henriksen commented 6 years ago

After 3 days of effort I've found a way to make this work, but it was way more difficult than it needed to be. I would have had a much happier go of it if this were pre-built into create-react-library, but ah well. I understand where you're coming from.

For anyone who finds this and is looking for a component module that uses mobx for state you can look at my github repo for react-json-grid which is itself built from stealing the build code out of mobx-form.

Thank you for looking into this. I think the powers that be are underestimating how much the decorator code really helps people. Hopefully they will prioritize this higher and babel will get the feature back into the main line sooner rather than later..