TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Facebook just updated its relationship status with Web Components

134 pointsby mmcclureabout 1 year ago

11 comments

danielrhodesabout 1 year ago
It seems like Web Components are ideal for libraries shipping pre-built components, which is probably why Mux finds it compelling. From Mux&#x27;s point of view, they want the highest level of compatibility with the least amount of framework lock-in. For example, they don&#x27;t want to have to ship a library for React and another one for Vue and another one for bare bones JS&#x2F;HTML.<p>In terms of building a web app where you control the environment end-to-end, I don&#x27;t think there&#x27;s any inherent upside to using Web Components over React.
评论 #40290924 未加载
评论 #40292970 未加载
评论 #40294084 未加载
评论 #40295135 未加载
continuationalabout 1 year ago
&gt; Web components get imported and registered at the global level. This also means if two different libraries have a component called my-button, you can’t use both of them.<p>In my opinion, fundamental problems like these really ought to be addressed <i>before</i> things become part of the web platform.
评论 #40293500 未加载
评论 #40294250 未加载
brundolfabout 1 year ago
I thought this was going to be about shipping web components made with React, but it&#x27;s about <i>consuming</i> web components from apps made with React, which is a much more sensible thing to do in my opinion<p>The problem with web components is that they&#x27;ve never had a templating&#x2F;reactivity story, which means if you wanted to build one reactively you&#x27;d have to ship it with a framework, and shipping a separate framework per-component is just unworkable. So they don&#x27;t make sense internally to an app, and they don&#x27;t really make sense for a large library of components. They only really make sense for a single hand-crafted widget that a company wants to ship to various consumers who may be using different frameworks<p>My dream is still that browsers come up with an actual reactive-templating API for HTML. If they did that, we might finally be able to get rid of frameworks for many common use-cases
davekissabout 1 year ago
The good: this seems like a necessary step towards standards-based development<p>The worrying: we might be setting up for a scenario where newer developers are bewildered by mixed paradigms within what was (at least once upon a time) a simple library<p>Full disclosure I work for Mux (OP), so as a team we&#x27;re web component fans, but I&#x27;m personally still almost exclusively writing React. So...personally, saying this with love, but add this to all the new esoteric hooks in React 19 and it feels like React might be losing the plot.
评论 #40291756 未加载
评论 #40291512 未加载
评论 #40291609 未加载
_akheabout 1 year ago
Why hasn&#x27;t Facebook made a browser that runs React&#x2F;JSX as native code? Should work well for their ad business.<p>Make a Llama 3 based search as the home page :) And fully support AI&#x2F;LLMs in the browser :)
评论 #40299379 未加载
评论 #40293509 未加载
c_s_guyabout 1 year ago
One of the biggest problems I run into with Web Components is how to share common CSS styles between them. I understand that goes against the idea that each web component should be encapsulated, but sometimes this is desirable.<p>Say you have a component library where each component depends on a base set of styles and you don&#x27;t want to load duplicate styles for each component.<p>Is there a best practice around this yet?
评论 #40294336 未加载
评论 #40293927 未加载
inopinatusabout 1 year ago
Alas that Web Components will be forever held back from their true potential until WebKit pulls their obstinate finger out and implements the customised built-ins half of the standard. Or proposes something better that otherwise solves the content model issues. To date they have done neither, leaving us with a shortfall of composability and a fistful of janky polyfills
评论 #40295127 未加载
DanielHBabout 1 year ago
&gt; But that doesn’t exist in the web components world (at least not yet). When you use &lt;my-button&gt; in a React component, you don’t have to explicitly import my-button from anywhere inside that file.<p>Technically you can just export a string with the name of your web component:<p><pre><code> export const MyButton = &#x27;my-button&#x27; import MyButton from &#x27;.&#x2F;MyButton&#x27; ... return &lt;MyButton &#x2F;&gt; </code></pre> But you do have to make sure there is no name clash. And since this is more of a convention any web components libs you pick up will probably not do this.
dbbkabout 1 year ago
In 18 years I have never once actually used a Web Component. What is the point?
评论 #40291732 未加载
评论 #40292580 未加载
评论 #40293335 未加载
评论 #40291799 未加载
评论 #40294357 未加载
daxfohlabout 1 year ago
Embrace, extend, extinguish?
评论 #40292515 未加载
j-bosabout 1 year ago
Having worked with internal company web components, I despise them. In a bureaucracy, bad and buggy web components are a blight because, unlike a bad React component,ad hoc fixing them requires a mess of searching and tons of boilerplate. I accept this news with mourning.
评论 #40291150 未加载
评论 #40290757 未加载
评论 #40290868 未加载
评论 #40293150 未加载
评论 #40292603 未加载
评论 #40290747 未加载
评论 #40293163 未加载
评论 #40290887 未加载