Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Update README with babel plugin ordering #41

Closed
mgcrea opened this issue Apr 21, 2016 · 4 comments
Closed

Update README with babel plugin ordering #41

mgcrea opened this issue Apr 21, 2016 · 4 comments

Comments

@mgcrea
Copy link

mgcrea commented Apr 21, 2016

Had a hard time today figuring out why a very simple mobx react sandbox app did not work.

Turned out that the issue was due to the order of babel plugins in my .babelrc.

transform-decorators-legacy has to appear first in the list, otherwise it will break with at least either transform-function-bind or transform-class-properties plugins if they defined before it, with the wrong orders, observables are not triggered at all.

Would be great to update README to clarify this.

@mweststrate
Copy link
Member

wow, never noticed that the order is relevant. thanks for reporting, I'll update it

@mgcrea
Copy link
Author

mgcrea commented Apr 22, 2016

Maybe that's something that mobx could detect/catch? (like if the class property decorator gets a function instead of an object/array ref), would be great to add a console warning if it can be safely detected.

@mweststrate
Copy link
Member

good one, I'm gonna check whether it is detectable

@samhh
Copy link

samhh commented Aug 9, 2017

Thank you so much for posting this, I've been tearing my hair out trying to understand why nothing was working.

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

3 participants