tomchentw / react-toastr

React.js toastr component
https://tomchentw.github.io/react-toastr/
MIT License
619 stars 112 forks source link

[UPDATE] Updated packages to latest build #44

Closed NullDivision closed 8 years ago

NullDivision commented 8 years ago
NullDivision commented 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.

tomchentw commented 8 years ago

@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
NullDivision commented 8 years ago

I made the requested changes and left a comment on consideration towards .babelrc.

tomchentw commented 8 years ago

Thanks! Released v2.3.0

tomchentw commented 8 years ago

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?

screen shot 2016-01-05 at 9 46 14 am
NullDivision commented 8 years ago

Flowcheck-loader does what you want. Provided that you add the @flow comment tag and do flow init to generate the .flowconfig.

tomchentw commented 8 years ago

@NullDivision I've checked that, but it seems flowcheck is outdated for a while. Maybe I should give babel-plugin-typecheck a try.

NullDivision commented 8 years ago

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.

tomchentw commented 8 years ago

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.

NullDivision commented 8 years ago

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 :)

tomchentw commented 8 years ago

Yup, so I only put it under specific env.

{
  "env": {
    "test": {
      "plugins": [
        "transform-runtime",
        "typecheck"
      ],
    },
  },
  "plugins": [
    "transform-flow-comments"
  ],
  "presets": [
    "es2015",
    "stage-0",
    "react"
  ]
}