-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create-react-app@2 support #40
Comments
First bug: #41 After reading #41 (comment) I'm not sure whether CRA@2 and #41 are related to each other. |
I reported an issue to RCA team because I don't have any idea why it does not work: facebook/create-react-app#5387 |
Does #41 happen by default or only when building for production? I need to somehow warn people about this issue in the blog post and documentation. So I'd like to understand at what stage we should do that. |
Both modes produce an application that does not work :( |
Could you make a PR to the documentation? I think we should add an Also, I think we need to add |
|
Docs: Added a warning about lack of support for `create-react-app@2`. See ckeditor/ckeditor5-react#40.
Docs: Added a warning about lack of support for `create-react-app@2`. See ckeditor/ckeditor5-react#40.
This issue shouldn't occur anymore after merging babel/babel#8920. |
Can confirm. Last week it didn't work, now it does. |
Interesting, because babel/babel#8920 is still open... Are you sure that you haven't changed something else (e.g. switched off transpilation to ES5)? |
Sorry, you are right. It might have had to do with me tweaking some configuration. |
I just downgrade the react-script version from 2.1.1 to 1.1.5 , it works |
Unfortunately, we're waiting for babel/babel#8913 to be fixed, but from the discussion, it seems that this is a pretty complex bug so it's hard for us to help there. |
We are at the point that looking for a good HTML editor in our new application and we like CKEditor 5. |
It seems that
Anyway, you should be able to avoid ejecting your config when using this package. It may not be future-safe, but should work. However, I started thinking – assuming that you're using a custom CKEditor 5 build (instead of integrating from source) the only reason why you can't use that CKE5 build with CRA2 without ejecting right now is babel/babel#8913. What if we change the source code of CKEditor 5 to avoid this bug? We actually did that in the past already. @pomek could you look into this? It won't unblock using CKE5 from source in CRA apps, but it will make using builds possible. |
I've just stumbled upon facebook/create-react-app#5387 (comment) by @eugene-kovaljov:
My understanding is that it will allow using a custom CKE5 build even in a non-ejected CRA2. |
If that works it could be a possibilty. The main disadvantage of using it as a static asset is the it can't be lazy-loaded. In our case only most users won't use the editor. I quess Razzle is also a possibilty although CRA is much more supported. |
@Reinmar, in fact, the fix is really simple. The described issue touches this part of our code: https://github.com/ckeditor/ckeditor5-utils/blob/5978e4c62580d2691c6689ee17db4fbeba465159/src/emittermixin.js#L240-L248 We can replace it with: events.forEach( eventName => {
const destinations = this._delegations.get( eventName );
if ( !destinations ) {
this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
} else {
destinations.set( emitter, nameOrFunction );
}
} ); Does the same and works the same as the original code and thanks to that, CRA works without errors. |
Cool! Let's go for it :) Can you make a PR (in ckeditor5-utils as well as in the react integration guide, because we'll not need that warning anymore). |
Other: Replaced `for..of` statement in `EventEmitter` with `Array.prototype.forEach`. This changes allows building a React application using `create-react-app@2`. Closes ckeditor/ckeditor5-react#40.
I've just merged the fix, but note that it won't work with NPM's builds until we release new versions of |
Docs: Removed warning about CRA@2. See ckeditor/ckeditor5-react#40 (comment).
I couldn't find when are you planning to release the next NPM build. There is any date? I would like to start using it in my production React project, and probably start to contribute with plugins soon! |
Hi @murilocruz!
We plan to ship new NPM versions within a week, so stay tuned 🙂 |
Any updates on this? Hurts to try to use a commercial product and it no workee :) |
Got the same issue. And the only way i can do is to wait |
2 hours left before I'm officially disappointed! More seriously it looks like a lot of people are waiting for this, can we have any update? |
Most probably we will release a new version tomorrow. |
We've just released new versions of our builds. Each of them is working with |
https://reactjs.org/blog/2018/10/01/create-react-app-v2.html
AFAIR one of the things that was supposed to change was support for ES6 dependencies. So perhaps we can test it and improve the integration guide.
The text was updated successfully, but these errors were encountered: