153
u/thegodzilla25 19h ago
All of this nonsense couldve been avoided if web components arrived a bit early.
51
u/lovin-dem-sandwiches 16h ago
When we were looking at Web components, the biggest drawback was the inability for shared state. Web components work well in isolation (maybe the intent?) but imo, the wc spec failed to understand why most people reach for a framework like react, vue, svelte etc
21
u/Alokir 16h ago
Yeah, the whole selling point of React was its simplicity, that data goes down and evens go up, as opposed to two way data binding. Also the flux architecture that dictates how common state is shared and updated.
By the time web components became widely available and fully supported in browsers, everyone was already using React, Angular or Vue.
11
u/theScottyJam 14h ago
...And if web components were well designed. The things are unnecessarily complicated to work in.
2
u/thegodzilla25 7h ago
Guess why we get abstractions over that as well like LitJS. All this because html css and js couldnt be used as a good enough abstraction for building webapps. Mainly because it was never designed to in the first place
2
u/hyrumwhite 10h ago
Web components are so boilerplatey the best way to use them is through a framework.
If they’d arrived earlier we’d have just had more polymers and stencils
132
u/sadongrohiik 19h ago
Oh the JavaScript petard, it just cannot stop hoisting, can it? How long till we get a framework to compile C into react?
70
65
u/ErnieBernie10 19h ago
What the hell is this even useful for
61
u/analytic-hunter 19h ago
I thought the same, but thinking about it a bit and it could make sense for making libraries
things like material UI
16
u/Necessary_Mail9698 17h ago
So it’s actually used to maintain SDKs for different JS frameworks. You write it once and you’ve got the SDK for each framework. It’s part of company called Builder.io, which has a CMS product and they have SDKs to dynamically render websites. They use mitosis to maintain the SDKs.
13
u/SaeculumObscure 18h ago
Might make it easier to switch from one framework to another without having to rewrite your entire codebase first?
37
u/-Redstoneboi- 18h ago
first you'd have to write it in mitosis
37
u/Prudent_Ad_4120 17h ago
In three months, you'll have to rewrite it for Mitosis 2, a complete redesign of the framework!
14
u/noobjaish 17h ago
Don't worry Mitosis 2 can be converted to Mitosis from their website, and Mitosis 3 will include a transpiler that *should work most of the time.
15
u/-meowstar- 16h ago
Then a big company will fork Mitosis 2, call it “Meiosis”, and a partially incompatible competing ecosystem will develop around it.
7
1
u/aaaasimar 3h ago
We considered this tool in a previous role which relied very heavily on a cshtml pages and SEO was critical. It allows you to build a front-end experience in a modern framework, which is then "compiled" down to individual components of static JS and CSS (instead of an whole app bundled together), so they can be ported page-by-page into the main app.
0
0
31
12
u/Soilblood 19h ago
Yo dawg! Check this shiz out! We put this here abstraction into this other abstraction so whenever you want cherry pop or cola bana pineapple flavor all you got to do is pour in the premix, press the wazoo here and out comes primo bussing abstract to the shoon gold shit out the other end all day eberry day! Yo code is 120% mo' pimped out than ever, ya feelin' me? Yafelin'me! Zeebit out yo!
29
u/AmazinDood 19h ago
why does that actually seem kinda useful
126
u/sadongrohiik 19h ago
Because we dug a hole so deep that our only way to get out of it seems to be digging so far we come out the other side
14
u/TerminalVector 19h ago
No, no dig UP stupid.
7
3
u/who_you_are 19h ago
But but, up is down in Australia.
And in space it is... Somewhere...
3
1
u/-Redstoneboi- 13h ago
we need a tool to compile digging instructions into both up and down variants
1
12
u/LowB0b 19h ago
It is actually useful, something similar has existed for a while https://stenciljs.com/
0
7
u/1mahmoud503 19h ago
it looks useful, it smells like useful, But i don't think it's anywhere near useful
(aside from experimentationz)
9
u/sadongrohiik 19h ago
Unfortunately it's aimed at a real problem. You start a project, initially write in react, it grows you now have 42 services across 5 teams. One of them ends up adoption svelte, another Vue, another Qwik (god I hope not) for various reasons. Now you're in a situation where you have to implement features that have been already developed in service A (react) to service B (svelte) you have to also rewrite it in svelte, and updating it requires updating both of them. It's bad out there...
16
u/puan0601 19h ago
does the spec not require react? how are teams allowed to go rogue? sounds like a governance issue
5
u/sadongrohiik 19h ago
You're vastly overestimating the average governance capabilities of most organizations but this is almost universal across large organizations. It's not just due to governance. Acquisitions and mergers play a big role (like if google acquired a start up where the codebase is in Vue, they're can't rewrite it into something else. Then you have third party enterprise tools (open source or otherwise, like the team realizes adopting some existing open source tool and modifying it would be far cheaper, but the tool is written in svelte and the rest of your codebase is written in Vue)
1
u/KazuDesu98 19h ago
Over time things may shift. Like a lot of people don't like react, often for a good reason. So maybe they pivot to svelte (which has a much better syntax than react if we're being honest, and is much faster at runtime), but dont want to have to reimplement every existing part of the codebase. So they just link existing react pages to new svelte pages. Not saying its the best way to do it, not by a long shot. But lets be honest, were talking about enterprise here.
1
u/puan0601 19h ago
sounds like a really crap product org that doesn't value homogenous tech stack. I don't know many enterprise tech specs that don't require a certain framework for ease of maintenance if nothing else. still think it's a governance issue at core.
5
u/TheSkiGeek 19h ago
In fairness, what you’re describing as “ease of maintenance” is how you end up with things running on mainframes and COBOL forever even when the underlying tech is hopelessly obsolete.
3
3
u/Dope_SteveX 19h ago
Well could be aimed at design system creators. Have a company wide design system written in this and let anyone implement it in whatever they want. We used stencil exactly for this. The implementation wasn't always smooth sailing but the idea is there.
1
u/sadongrohiik 18h ago
Stencil is probably a lot more maintainable than this monstrosity though since it compiles to web components. Compiling to a bunch of js frameworks with constant deprecations, runtime and syntax changes, changing dependencies, etc is pure nightmare fuel
2
u/Dope_SteveX 18h ago edited 18h ago
Probably. I haven't looked into this, how it works and how serious it is. But web components under the hood means own sets of problems and things you would expect to work not working. So if they would manage to maintain this properly it has the potential to be better.
9
u/Cat-Satan 18h ago
We created a compiler to compile to code for another compiler
9
9
13
5
4
u/berrywhit3 18h ago
Who should use this? If some kind of cross platform framework like Flutter would be supported, I could see the potential but its basically a cross web framework compile framework.
5
5
u/ProbablyBunchofAtoms 4h ago
Js devs out there inventing their own problem and making their own solutions
3
u/phoenix1984 17h ago
This has been around for a while. I wasn’t aware that it was still an active project. If you’re building a library or framework that you want multiple JS component frameworks to be able to use, like react, angular, Vue, and svelte, it’s a great tool.
2
1
0
u/Positive_Method3022 19h ago
And the naming is really not good. What fuck mitosis has to do with what it does??? I'm not connecting the ideas
2
u/-Redstoneboi- 18h ago
mitosis is when one cell splits into two
one codebase gets compiled for two (or more) frameworks
-1
0
-5
402
u/DmitriRussian 19h ago
Maintaing this sure sounds fun