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
Using froala in modern environment #1668
Comments
@stefanneculai I must insist because for us it's not an enhancement but a bug. I have to change the minified version of froala to make it work. I'm not against your business plan, we are planning to buy oem license, but at least with open-source I could have submit a PR. |
@JSteunou did you get anywhere with this? Once you've required froala is it then accessible in the global |
Nope. There really is a bug. Did you try to work with tools like webpack or rollup, either with CJS or ES6 require / import? So I'm saying it again, please flag it like a bug and either fix it or help us help you to fix it. |
@JSteunou just to be clear, i'm not a maintainer with Froala. For your info, I got it working using ProvidePlugin and manually attaching jquery to the window object (but I think that can be improved using the expose loader)
and in
|
Yeah I cheated too, but really not a big fan. How should I feel if a client tell me that a form in my app do not work on his mobile and I tell him it's not a bug as it works through is desktop. Same here. |
@JSteunou @jwhitmarsh For now the editor needs jQuery. It is on our plan to remove the jQuery dependency over the next period. For now for importing with webpack, please use the plugin provider as they describe in their docs: https://webpack.github.io/docs/shimming-modules.html#plugin-provideplugin
An example for es6 will come shortly. |
@stefanneculai but we should not have the be forced to shim! You already did 75% of the job adding an UMD loader with jQuery imported as dependency, there is just one and only one remaining call to a global jQuery in your code. Just use the imported jquery instance and that bug is fixed or allow me to PR and I'll do it for you. |
That global usage of jQuery inside the code has been fixed and isn't there anymore in v2.4.1. |
Hooo my bad I completely did not see this release! Then no need to shim for jQuery anymore! |
@stefanneculai just tested and indeed it works now. Just need to add a |
In regards to access to the un-minified source, I wonder if you could do something like Font Awesome 5, where they must use GitHub API's to add paying customers to their private repo. That way users of froala-editor can help debug the problem and submit PR's. Just an idea. |
@Panman8201 please see: #447 (comment). |
@JSteunou it's updated on npm now as. |
To get Froala working on webpack, the React installation instructions actually work great.
|
In my case I needed to import froala-editor like this:
This test at the beginning of the froala_editor.pkgd.min file: I hope this will help some of you ! |
Following on from @arambert's comment above, if you're using webpack, it will use the AMD module definition in Froala instead of the CJS one as it's defined first and the code he provided won't work. Adding this to your webpack config will ignore the AMD loader for just this file:
|
Hi,
seems you guys did a great job with this editor, but whereas it has modular architecture, it is not usable out of the box with modern tool chain (npm + webpack at least).
main
entry (so one have torequire('froala-editor/js/froala_editor.min');
)The text was updated successfully, but these errors were encountered: