DEV Community

Discussion on: Migrating a React codebase to web components

Collapse
 
thirdender profile image
thirdender

Having coded for IE6 "back in the day" and watched the slow-but-inevitable rise of jQuery, I think there are three reasons. First, browser implementation is always just a little different. We're spoiled now that almost all major browsers run on Blink or WebKit, but Gecko can still be temperamental at times. Using a community supported library means it is battle tested against all popular engines and a good library will "just work". Second, the best features are always almost ready. Even as HTML5 was being standardized, it took so long the standard itself was forked. Libraries have the benefit of being able to shim the best features and remove the shims when native support is widely available. Third, knowing and using the DOM API is almost always necessary for native features, and that is in and of itself a pain point still.

Native solutions should always be the goal. But libraries are part of the natural evolution of features that developers actually want to use.

Thread Thread
 
maroun_baydoun profile image
Maroun Baydoun

Knowing and using the native DOM APIs are a necessary "pain". I see people all the time jumping on the React/Vue etc. bandwagon without learning the basics of how browsers work and how to manipulate the DOM. The DOM APIs are not some sort of low-level machine code. They're highly abstracted and usable. Yes, they can be verbose and yes they can be confusing sometimes but learning them is way easier than grasping how React/Vue work.

I wrote about the topic a while ago because I see the issue happening all the time. maroun-baydoun.com/blog/dont-start...