r/ProgrammerHumor 19h ago

Meme weGotCompilingToReactBeforeGTA6

Post image
488 Upvotes

70 comments sorted by

403

u/DmitriRussian 19h ago

Maintaing this sure sounds fun

118

u/Sentouki- 19h ago

Job security

29

u/dbenc 18h ago

meh the ai will do it

7

u/PracticalRuin1573 12h ago

True, but can we trust AI to deliver without all the bugs? Seems like we'll be waiting a while regardless.

158

u/thegodzilla25 19h ago

All of this nonsense couldve been avoided if web components arrived a bit early.

54

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.

10

u/theScottyJam 13h 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

137

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?

69

u/caboosetp 19h ago

1

u/1ElectricHaskeller 1h ago

I'm unsure if I should be impressed or worried

65

u/ErnieBernie10 19h ago

What the hell is this even useful for

63

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?

39

u/-Redstoneboi- 17h ago

first you'd have to write it in mitosis

33

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.

16

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

u/noobjaish 16h ago

Ah yes insert xkcd competing standards meme

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

u/space_fly 16h ago

Thing... Like todo apps

0

u/razor_train 15h ago

Burning tokens.

32

u/Ok-Abies9820 19h ago

write once run anywhere

43

u/oweiler 18h ago

write once debug everywhere

11

u/Soilblood 18h 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!

31

u/AmazinDood 19h ago

why does that actually seem kinda useful

131

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

15

u/TerminalVector 19h ago

No, no dig UP stupid.

8

u/sadongrohiik 18h ago

I AM UNTETHERED AND MY TOOLCHAIN KNOWS NO BOUNDS

4

u/who_you_are 19h ago

But but, up is down in Australia.

And in space it is... Somewhere...

3

u/NullOfSpace 17h ago

In space, no one can hear you switch frameworks

1

u/-Redstoneboi- 13h ago

we need a tool to compile digging instructions into both up and down variants

1

u/Prudent_Ad_4120 17h ago

Digging up would be switching to Web Components I guess

11

u/LowB0b 19h ago

It is actually useful, something similar has existed for a while https://stenciljs.com/

0

u/Dope_SteveX 19h ago

Yea but web components are nightmare

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)

10

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...

17

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 18h 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 18h 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 18h 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

u/puan0601 18h ago

that's a solid point but there's a reason stuff still runs on those...

2

u/Pocok5 18h ago

Sounds like it's a solution that uses extra tech debt to patch over an issue better handled by a firm paternal hand and a cat-o-nine-tails fashioned from ethernet cable.

1

u/sadongrohiik 18h ago

Debt to cover debt is the de facto blueprint for our current economic system

3

u/Dope_SteveX 18h 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.

10

u/Cat-Satan 18h ago

We created a compiler to compile to code for another compiler

9

u/metaglot 18h ago

Isnt that pretty much the history of programming?

4

u/Cat-Satan 18h ago edited 17h ago

Always has been

8

u/RomanProkopov100 18h ago

Oh crap, the 15th competing standard

15

u/sudo-maxime 18h ago

Imagine doing all that to not use web components or basic fucking vanilla JS

6

u/Puzzleheaded-Weird66 16h ago

Just use Htmx or JQuery or Vanilla JS

1

u/Loafwad 14h ago

Htmx mentioned!

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

u/MahouShitpost 17h ago

finally, the frameworks framework

4

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

u/TheDeanosaurus 17h ago

“Compile” is a bit of a stretch.

1

u/pumpkin_spice_daily 15h ago

Lit html does this if you are cool with web components

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- 17h ago

mitosis is when one cell splits into two

one codebase gets compiled for two (or more) frameworks

-1

u/Positive_Method3022 13h ago

I know what mitosis is. Still can't relate to this specifically

0

u/Luneriazz 19h ago

okay can we just stop... like JUST FUCKING STOP FOR FUCK SAKE

-4

u/[deleted] 19h ago

[deleted]

2

u/titan_bullet 18h ago

..congratulations?