facebookarchive / flux

Application Architecture for Building User Interfaces
https://facebookarchive.github.io/flux/
Other
17.42k stars 3.47k forks source link

fix: Container.create doesn't work with Babel v7.10 #495

Closed koba04 closed 3 years ago

koba04 commented 4 years ago

As #486 #489 mentioned, Container.create does not work with Babel v7.10. To fix this, I've updated the version of Babel to the latest version. I've also updated fbjs and used babel-preset-fbjs instead of fbjs-scripts because I have to use stripDev option.

I'm not familiar with fbjs and a module system that facebook uses, so please correct me if I misunderstand.

This version still seems not to work with a project based on cra, so I'll investigate it.

"cannot be invoked without 'new'"

I've published this version as a forked package @koba04/flux, so you can test the build with the package.

kyldvs commented 4 years ago

Thanks for working on this! @yangshun or I can help with a release when this is ready to go

rvignacio commented 3 years ago

I tested this PR in the context of my previously failing project and it works with latest Babel version (#489).

koba04 commented 3 years ago

@rvignacio Thank you for testing this!

Bloomca commented 3 years ago

@koba04 I tested your package (@koba04/flux) in our project and it also works with the latest Babel version.

koba04 commented 3 years ago

@Bloomca Thank you for testing this! This seems to work fine with the latest version of Babel.

koba04 commented 3 years ago

@kyldvs Could you review this?

yangshun commented 3 years ago

Thanks a lot @koba04! I'll merge first and resolve some of the conflicts. We aim to release a v4.0.0 this week.

koba04 commented 3 years ago

@yangshun Thank you for merging this! Please let me know If there is any problem. I'll work on this.

yangshun commented 3 years ago

@koba04 We've released v4.0.0! Would appreciate if you could help to test it 😄

fastman commented 2 years ago

I can confirm that it works with @babel/preset-react@7.16.7

Package Type Update Change
@babel/core (source) devDependencies minor 7.8.7 -> 7.17.2
@babel/plugin-transform-classes (source) devDependencies minor 7.8.6 -> 7.16.7
@babel/preset-env (source) devDependencies minor 7.8.7 -> 7.16.11
@babel/preset-react (source) devDependencies minor 7.8.3 -> 7.16.7
babel-loader devDependencies minor 8.0.6 -> 8.2.3 Package