gcanti/babel-plugin-tcomb

Recommended ordering issue

chrisblossom opened this issue · 2 comments

I found out an issue when following the recommended order listed in README.md under Setup

"presets": ["es2015", "react", "stage-0"] // bad
"presets": ["stage-0", "react", "es2015"] // good

According to @hzuu (See: phabricator.babeljs.io/T7575) The recommended ordering should be reversed:

"presets": ["stage-0", "react", "es2015"] // bad
"presets": ["es2015", "react", "stage-0"] // good

Unless there is a reason related to tomb, would you be opposed to me putting in a PR to fix the ordering?

Also, the recommendation of passPerPreset: true breaks my build. From what I have read it is an experimental feature that is not 100% ready yet. Is it really required for tcomb to work correctly? I have not had any issues yet without it that I have seen (yet).

@chrisblossom I was the one who suggested this order. It's the only one that worked for me using passPerPreset.

@chrisblossom thanks for rising this issue, I'm not happy with that as well.

I'm afraid those requirements are the result of empiricism rather than science, I experienced many different ways of breaking the build, and it seems to depend on which presets AND plugins are installed. Also what breaks and how seems even change over time.

I'm ok with removing the current recommendations as long as we add a warning suggesting to try to tweak the preset order and / or the passPerPreset boolean if something goes wrong