Skip to content
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

Remove jQuery dependency? #391

Closed
dandv opened this issue Sep 7, 2016 · 15 comments
Closed

Remove jQuery dependency? #391

dandv opened this issue Sep 7, 2016 · 15 comments

Comments

@dandv
Copy link

dandv commented Sep 7, 2016

Just wondering, in the light of this post, how difficult it would be to remove the dependency on jQuery.

@Alex-D
Copy link
Owner

Alex-D commented Sep 7, 2016

If I remove jQuery (and it should be possible in v3) I will rewrite the plugin and do not base Trumbowyg on buggy execCommand.

I know that is not possible/hard yet to remove the dependency on jQuery :/

@SmoshySmosh
Copy link

@Alex-D Have you thought about replacing jQuery with something like cash? It seems to cover most of what jQuery does but at a fraction of the size. I believe around 3kb~ gzipped.

Would this be a difficult task?

@Alex-D
Copy link
Owner

Alex-D commented Oct 7, 2016

There is no AJAX support, so it's hard yep :/

@SmoshySmosh
Copy link

You're right... Although there is a pull request on the repository that we could try to give a little shove... I may be bias, but I love this WYSIWYG editor and I would love it even more if I didn't have to require jquery due to its size... Let me know of you need any help, I wouldn't mind contributing.

@DoomyTheFroomy
Copy link

@SmoshySmosh 👍
@Alex-D is this only the line 177? Or are there more problems? Because a request is also pretty simple in VanillaJS. I would also help, because this would made this WYSIWYG editor more awesome! And save loading time 😏

@Alex-D
Copy link
Owner

Alex-D commented Oct 7, 2016

Because a request is also pretty simple in VanillaJS

I know. I'm not fan of jQuery anymore. But if the ajax support could be supported by cash it could be cool. Upload plugin use it too.

@DoomyTheFroomy
Copy link

DoomyTheFroomy commented Oct 7, 2016

@Alex-D sorry what I meant, was not to switch from one library to another, I would recommend to use Vanilla JS or better say pure JS. Without any use of extra library. I think this should also work?! 😏

@Alex-D
Copy link
Owner

Alex-D commented Oct 7, 2016

I know what Vanilla JS is. But XHR Requests are not so easy to support on each browsers, especially IE/Edge :(

@SmoshySmosh
Copy link

I believe we have a few options for XHR, remember the goal is to keep the final size down.

https://github.com/pyrsmk/qwest - 2.2kb
https://github.com/dimitrinicolas/marmottajax - 1.8kb
https://github.com/typicode/fetchival - 0.6kb

Thoughts?

@DoomyTheFroomy
Copy link

@Alex-D 👍
@SmoshySmosh fetchival looks great and close to this, what I would have in mind.

@richardtallent
Copy link

I recommend Axios as an option for XHR requests. It's the standard library AJAX requests for Vue, which I also use. (Trumbowyg is one of the few non-Vue components I still use, and the only one that depends on JQuery.)

@DoomyTheFroomy
Copy link

@Alex-D if you need any help with anything let me know

@pwFoo
Copy link

pwFoo commented Jun 3, 2018

Axios and axios.all() is nice, but I like the minimal size of fetchival.

cash is also a nice small jQuery replacement.
Alternatives could be umbrellajs or maybe it's easier to move to zeptojs (compatible with some jquery methods, ajax,...)?

@aguilera51284
Copy link

unfetch

@Alex-D Alex-D added this to the v3.0 milestone Nov 4, 2018
@Alex-D
Copy link
Owner

Alex-D commented Nov 15, 2018

I plan to remove jQuery dependency in version 3.

See #875 for more details.

@Alex-D Alex-D closed this as completed Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants