fluxo-js / fluxo

Fluxo is a simple, lightweight (~300LOC) and dependency free data infrastructure lib based on Facebook Flux and Backbone.js. It's compatible with React.js, but you can use with whatever you want to the view/component layer.
15 stars 3 forks source link

Mutating prototype warning #38

Closed LucasArruda closed 8 years ago

LucasArruda commented 8 years ago

Hi!

I'm using fluxo but I'm getting the current warning:

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

I checked the code and I think the culprit probably is: Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; which can be found here https://github.com/fluxo-js/fluxo/blob/master/dist/fluxo.js#L19

The suggestion is to use Object.create() -> http://stackoverflow.com/a/23809148

I could help if needed.

Thanks!

samuelsimoes commented 8 years ago

Thanks for your report.

After a quick search, I found that it's a problem with Firefox and Babel transpiled code. Looks like other folks are getting this error too https://github.com/zenorocha/clipboard.js/issues/141#issuecomment-190981540

So, apparently we don't have too much to do about this besides getting rid of ES6 classes with Babel.js, which will not happen. 😕

I'll let this open to future checks if Babel's team found some solution or something changed in Firefox.

LucasArruda commented 8 years ago

@samuelsimoes thanks for the reply! Then I should close it.