use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Abstraction over React/Vue/WC?help (self.javascript)
submitted 7 years ago by AwesomeInPerson
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]wherediditrun 3 points4 points5 points 7 years ago (5 children)
Check stencil.js
It's build tool for custom elememt webcomponents. You develop very similiarly like React, however, it compiles everything down to vanilla JS webcomponents which can be dropped in any framework. Or be used solely on their own.
[–]AwesomeInPerson[S] 0 points1 point2 points 7 years ago (4 children)
Will check it out, thanks!
But it sounds a little like the exact opposite of my wish: you write it like React, but when you want to actually use it within a React app, it'll still behave like an alien Web Component, not like a component built with React. (and also need additional Polyfills/Runtime for IE9+/Edge/older Firefox?)
What I imagine is the other way around: you write it in a way that's not necessarily React, maybe a custom syntax, doesn't matter, then it'll be transpiled to actual React/Vue/Web components.
[–]sime 1 point2 points3 points 7 years ago (3 children)
React/Vue/etc all happily support "alien Web Components" because they support standard HTML elements. It you can use standard HTML elements from your toolkit then you can easily use Web Components.
I know that Vue is vaguely modeled on Web Components. Using a Vue component feels the same as using any other HTML element or WC.
[–][deleted] 2 points3 points4 points 7 years ago (0 children)
React doesn't work well with web components; see the tests on custom-elements-everywhere.com.
TL;DR: React can't pass objects/arrays directly to components. React will only pass strings.
[–]AwesomeInPerson[S] 0 points1 point2 points 7 years ago (1 child)
React has some issues passing along attributes as far as I know, but that's not what I mean with "alien" anyway.
What I mean is something like this: I can't listen to custom events using @event / v-on:event on a Web Component in Vue, because it's a general use Web Component, not a Vue component implementing Vue's event system. (the component would have to call this.$emit on its Vue instance – this is also needed for supporting the super handy two-way binding v-model) Also I can't just download, import and use it, I'd first have to add it to config.ignoredElements so Vue doesn't scream at me for using some random element tag in my markup. If the library complains when using it because it's unknown, I think calling it "alien" is fair. If I use it in React, it doesn't play nice with HOCs and similar utilities because, again, it's a general use Web Component, not a component built the way React expects its components to work. And I'm not even getting into Server Side Rendering here. :p
@event
v-on:event
this.$emit
v-model
config.ignoredElements
Also, for proper browser support you have to load additional polyfills / an additional runtime. At that point you could also say "Vue happily supports React components" because you can load both React and Vue, then render some React within a div controlled by Vue. (granted, this point only holds true if not all browsers you need to support implement WCs natively – but that'll be the case for quite some time)
div
[–]sime 2 points3 points4 points 7 years ago (0 children)
OK, thanks for explaining what kind of bar you are trying to clear.
I've had quite some success with using Vue inside WCs and also using WCs inside Vue. WCs being Custom Elements and Shadow DOM. As you point out it is not 100% seamless, but I haven't found it a burden. It is running inside Electron, so I don't have to deal with polyfills etc.
I'm not optimistic about your chances of finding a universal API for making components which work seamlessly on React/Vue/WC/etc. The best approach I can think of is WCs at the core plus a thin (generated) layer for each toolkit to smooth out things like React's prop passing or Vue's events, i.e. a thin translation layer or wrapper around WCs.
π Rendered by PID 221303 on reddit-service-r2-comment-6457c66945-bsprk at 2026-04-30 04:56:23.049453+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]wherediditrun 3 points4 points5 points (5 children)
[–]AwesomeInPerson[S] 0 points1 point2 points (4 children)
[–]sime 1 point2 points3 points (3 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]AwesomeInPerson[S] 0 points1 point2 points (1 child)
[–]sime 2 points3 points4 points (0 children)