• <tfoot id='VbBAl'></tfoot>

      <i id='VbBAl'><tr id='VbBAl'><dt id='VbBAl'><q id='VbBAl'><span id='VbBAl'><b id='VbBAl'><form id='VbBAl'><ins id='VbBAl'></ins><ul id='VbBAl'></ul><sub id='VbBAl'></sub></form><legend id='VbBAl'></legend><bdo id='VbBAl'><pre id='VbBAl'><center id='VbBAl'></center></pre></bdo></b><th id='VbBAl'></th></span></q></dt></tr></i><div id='VbBAl'><tfoot id='VbBAl'></tfoot><dl id='VbBAl'><fieldset id='VbBAl'></fieldset></dl></div>

      <small id='VbBAl'></small><noframes id='VbBAl'>

    1. <legend id='VbBAl'><style id='VbBAl'><dir id='VbBAl'><q id='VbBAl'></q></dir></style></legend>
        <bdo id='VbBAl'></bdo><ul id='VbBAl'></ul>

        真的有必要制作和使用新的自定义元素和 Web 组件(HTML 标签)吗?

        时间:2023-09-07

      1. <small id='wpRwX'></small><noframes id='wpRwX'>

            <tbody id='wpRwX'></tbody>

                <tfoot id='wpRwX'></tfoot>
                  <bdo id='wpRwX'></bdo><ul id='wpRwX'></ul>
                  <legend id='wpRwX'><style id='wpRwX'><dir id='wpRwX'><q id='wpRwX'></q></dir></style></legend>
                  <i id='wpRwX'><tr id='wpRwX'><dt id='wpRwX'><q id='wpRwX'><span id='wpRwX'><b id='wpRwX'><form id='wpRwX'><ins id='wpRwX'></ins><ul id='wpRwX'></ul><sub id='wpRwX'></sub></form><legend id='wpRwX'></legend><bdo id='wpRwX'><pre id='wpRwX'><center id='wpRwX'></center></pre></bdo></b><th id='wpRwX'></th></span></q></dt></tr></i><div id='wpRwX'><tfoot id='wpRwX'></tfoot><dl id='wpRwX'><fieldset id='wpRwX'></fieldset></dl></div>
                • 本文介绍了真的有必要制作和使用新的自定义元素和 Web 组件(HTML 标签)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I'm currently learning Front-end web development and the difference between Vanilla JavaScript, frameworks and libraries (React for example). Now I'm familiar with web components for making new custom HTML tags. As I know, React is made for the same purpose, but when I visited the Instagram website (the first website that uses React that comes to mind) and looked at the HTML code, I didn't find any custom HTML element, in fact, most of the elements are made of "div"s tags. If a complex social media website like Instagram isn't made of custom elements, then who uses them and why?

                  解决方案

                  React is a totally different beast, dating back almost a decade. It was developed by Facebook because TOO many teams were doing TOO many updates in the same DOM. So they came up with a virtual DOM where all required DOM updates are merged before writing to the Browser DOM.

                  Works great for Facebook. Newer technologies like the Custom Elements API and Svelte (Compile, don't Transpile) have proven it is no longer the best solution.

                  Reacts outdated technology now scores a meager 71% on https://custom-elements-everywhere.com/

                  React and W3C Custom Elements are not friends

                  Because the Green DOM elements are not tracked by React.

                  And if you want to mix Green and Yellow you have to basically re-write/wrap each and every component into React syntax. Because React not only does DOM Elements different, but also does DOM Events different.

                  The future

                  This makes an interesting future: React and the W3C standard are diverging.

                  And the W3C standard is defacto set by Browser vendors,
                  not by the W3C, as we learned from the never implemented ECMAScript 4 saga (1999 - 2008)

                  So its

                  Apple (Safari) + Mozilla (FireFox) + Google/Microsoft (Chromium/Chredge)
                  versus
                  Facebook (No browser!)

                  'problem' with the W3C is all members have to agree on a standard; that is why it took years for the Custom Elements API to mature... and React got a head start

                  Facebook does now "own" 60% of the developers market...
                  but hey,
                  Microsoft had 90% of the Browser market... once,
                  and Flash was installed on nearly every device....once

                  The Custom Elements API will exist for as long as ECMAScript runs in the browser

                  It is not a framework or library! It is a language construct.
                  Not learning Custom Elements is like saying:

                  I am not learning Set or Map, I can do everything with Arrays

                  Older rant at: Web components - Services / non html components

                  Or believe the 2020 Front-End Survey:

                  这篇关于真的有必要制作和使用新的自定义元素和 Web 组件(HTML 标签)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在对象内部和对象外部处理js前端中的后端错误 下一篇:img 设置 flex-grow 填充 flex 容器剩余空间,导致 flex 内部溢出 flex 容器

                  相关文章

                    <small id='NdpaS'></small><noframes id='NdpaS'>

                  1. <i id='NdpaS'><tr id='NdpaS'><dt id='NdpaS'><q id='NdpaS'><span id='NdpaS'><b id='NdpaS'><form id='NdpaS'><ins id='NdpaS'></ins><ul id='NdpaS'></ul><sub id='NdpaS'></sub></form><legend id='NdpaS'></legend><bdo id='NdpaS'><pre id='NdpaS'><center id='NdpaS'></center></pre></bdo></b><th id='NdpaS'></th></span></q></dt></tr></i><div id='NdpaS'><tfoot id='NdpaS'></tfoot><dl id='NdpaS'><fieldset id='NdpaS'></fieldset></dl></div>

                    <tfoot id='NdpaS'></tfoot>
                      <legend id='NdpaS'><style id='NdpaS'><dir id='NdpaS'><q id='NdpaS'></q></dir></style></legend>

                      • <bdo id='NdpaS'></bdo><ul id='NdpaS'></ul>