Closed NullDivision closed 8 years ago
Hi. I noticed that the latest version of react-toastr uses an outdated version of fbjs so i went ahead and updated the package.
Everything still works and tests are passing.
@NullDivision WOW, thanks for the hard work! It looks great. I've left two code review comments. Please help to fix them and fixup the original commit with the following commit message:
feat(package.json): bump fbjs to ^0.6.0
* upgrade to babel@^6
I made the requested changes and left a comment on consideration towards .babelrc
.
Just found that @NullDivision had some experience with Facebook's flow. Just wondering that is there any way to run flow
as a loader step when using webpack
? It seems that I cannot find a proper way/existing loader plugin for that. But it should be doable?
Flowcheck-loader
does what you want. Provided that you add the @flow
comment tag and do flow init
to generate the .flowconfig
.
@NullDivision I've checked that, but it seems flowcheck
is outdated for a while. Maybe I should give babel-plugin-typecheck a try.
As far as I know that plugin only helps in transpiling type annotations from Flow. I'll have to integrate it into my project as well soon enough so if it's outdated I'll probably end up updating that too. Force of habit :D
If you want to run it at build time you can just add Flow as a devDependency and call it with a conditional operator followed by the build command.
If you want to use it with the webpack-dev-server it'll have to do with the loader.
On the other hand I run it currently on Sublime Text with SublimeLinter and it works great.
Haha, I just tried and integrated babel-plugin-typecheck
and babel-plugin-transform-flow-comments
to my babel6 projects. It works as expected (immediately caught one error) so I'll just them.
Cool. :) But take into consideration that it adds sizable overhead when transpiling as it adds exceptions to every function call. ...which isn't a bad idea but I'd rather implement my own catches for those :)
Yup, so I only put it under specific env
.
{
"env": {
"test": {
"plugins": [
"transform-runtime",
"typecheck"
],
},
},
"plugins": [
"transform-flow-comments"
],
"presets": [
"es2015",
"stage-0",
"react"
]
}