Hacker News new | ask | show | jobs
by acomjean 4194 days ago
Cool.

but why no jquery?

Just asking.

As someone who ported a embedded website away from jquery, it was painful, and I've come to really appreciate it

3 comments

Firstly jQuery would not help a lot here, as wysiwygs are largely about fixing browser inconsistencies and bugs. You'd like to fix those as close to the source as possible. The other quite big argument is that events triggered in jQuery cannot be seen by other modules correctly. Even not by another jQuery instance. In CMS-es on the other hand you can easily be dealing with many jQuery instances. One on the site itself and another for administration components. Vanilla.js makes things on this scale smaller too.
Having written a wysiwyg editor myself, the bulk of the work in such a project doesn't really touch on what jQuery does.

Assuming you're using contenteditable, a lot of it is about resolving cross-browser differences in the implementation. Probably also reimplementing most of the execCommands since they're wildly inconsistent -- which does involve some DOM manipulation, but is more about using the selection API.

I'm really glad they didn't use jQuery.

Note: I am using angular for 90% of my stuff.