15 ms·
React use C
- jrajav 3y agoAt first, from the title, I thought this might be a clever solution to the problem just created out of thin air that 'official' React apps with Next now require "use client" on a large fraction of previously working modules that were always intended to run on the client by default.
- teaearlgraycold 3y agoAs someone that's not bought in on "use server" yet - ugh. What the fuck were they thinking?
- ht85 3y ago> esbuild is not cursed enough The real takeaway. Love it. Hate it. All at the same time.
- HtmlProgrammer 3y agoBased repo
- cuddlyogre 3y agoThe todos gave me a belly laugh.
- SushiHippie 3y agoBest one so far: "Tell windows ppl to just use WSL (see #2)"
- vips7L 3y ago> Tell windows ppl to just use WSL Ah yes more non-portable code.
- ycombinatrix 3y agobig fan of your "/rpc/rce" endpoint
- JohnBerea 3y agoOur scientists were so busy trying to figure out if they could, they never asked whether they should.
- xyst 3y agoCome back to HN when it can run rust ;)
- andrewmcwatters 3y agoSomething something `use rust`.
- elnardu 3y agoHere https://github.com/elnardu/react-use-rust https://github.com/elnardu/react-use-rust
- cultofmetatron 3y agoI've been out of the node community for over 5 years but this seems in line with the "hurr durr use javascript for everything!!" crew. can someone tell me if this is a parody cuz I seriously can't tell anymore?
- nicoburns 3y agoThis one is definitely a parody / not a serious project.
- elnardu 3y agotbh, I sometimes cannot tell if real js projects are parodies
- flykespice 3y ago> can someone tell me if this is a parody cuz I seriously can't tell anymore? You just don't use javascript enough in your life.
- cultofmetatron 3y agowell you're not wrong haha. I switched to elixir for my startup so I haven't touched a javascript file in almost 4 years now. I don't feel like I'm missing much though.
- bambam24 3y ago[dead]
- junon 3y agoTL:DR it's a meme. The context here (as I understand it) is that Next.js, a popular React-like framework that allows (in a way) coding both the server and browser portions of a web app in one codebase, such that each portion is extracted at runtime and automatically wired up via API calls. This is a simplification but it's how you can think of it. They've now introduced an even tighter way of introducing server code into what are otherwise frontend React components by piggie backing off the old "use strict" directive syntax, called "use server", allowing you to interleave - directly and inline - the client and browser code. Many a meme have been created, half-jokingly comparing it to PHP, ranging from the supportive jest, to the very seriously critical, as one would expect the internet to do. Some of those memes have been in the form of "use ___", such as "use binary", "use php", etc. I don't use frontend frameworks much these days so maybe someone can correct me on some of this, but hopefully this helps explain it a bit. https://nextjs.org/docs/app/api-reference/functions/server-actions https://nextjs.org/docs/app/api-reference/functions/server-a...
- garrettjoecox 3y ago> await sleep(Math.random() * 5000); // gotta keep up with the trends Nice
- qudat 3y agoThe most interesting thing about this for me was “zig cc”: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...
- kritr 3y agoHey Elnard, you might want to consider using https://github.com/KritR/picoc-js https://github.com/KritR/picoc-js ;) Then you should be able to fully execute in browser.
- elnardu 3y agobrb compiling llvm to wasm
- sebastianconcpt 3y agoAwesome! Can't wait to see when React can html too!
- solarkraft 3y agoLove the todos: > Add typescript support > Remove typescript support Beautiful
- inopinatus 3y agoDefinitely forms some kind of implicit argument either for or against a belief in the wisdom of choosing JavaScript as a platform for, well, anything at all. Leaning towards against
- CSSer 3y agoIf it does, I think it’s a pretty poor argument. JS is the lingua franca of the web. The web is the platform. Frankly, I’d love it if there were some pure, high-level (but lower than the web), widely satisfactory “native” multi-platform solution with truly altruistic motives but I know of none. Serious engineering is done on the web motivated by strategic business decisions. Isomorphic JS remains a smart one that is purely independent of what you see here.
- subarctic 3y ago> Frankly, I’d love it if there were some pure, high-level (but lower than the web), widely satisfactory “native” multi-platform solution with truly altruistic motives but I know of none I want to say "WebAssembly" but that isn't it at all, since you're talking about the web, not JavaScript. The hypothetical platform you're talking about could use webassembly but that would be besides the point. Does a low-level version exist? Say, OpenGL?
- keyle 3y agoUntil React can cross compile in Rust and spawn a browser instance in WASM with a graphql interface, I will keep making sarcastic jokes about React. /s I started as a front-end dev, focused on that in the 2000s as this was where the work was interesting... Now I go by back-end dev, because I just can't deal with the front-end "industry" anymore. All the best, though.
- paulddraper 3y ago> can cross compile in Rust what does that mean
- postalrat 3y agoIf you think the front-end is a mess just wait to till you see the layers upon layers of complexity people are using the manage back-end services.
- 3y ago
- cdelsolar 3y agowhy
- EMM_386 3y agoFunny. I liked the TypeScript being added and then removed in the TODO. I've been working with the web since before JS and CSS existed, back in the cgi-bin days, and have somehow ended up still working with it to this day. I used most of the pre-SPA frameworks, when everything was what is now being referred to as "SSR". Then I was dragged (somewhat kicking, screaming, and muttering about 'kids these days') into the world of SPAs, except I ended up on the Angular side and have not really been on the React side. I will say that I have been following along with this Next.js stuff and the other changes going on over in the React ecosystem, and I am left utterly confused while at the same time having an uneasy feeling about the whole thing. It's not necessarily because we've seen all this before, it's more about "why now?", and then wondering about how badly this is going to be abused, because if it can be, it will be. I get it, people need SEO, FCP times need some help ... and ... well that's about what I came up with off the top of my head. Have you ever seen a SQL statement that JOINs 20 tables in your a component, that uses a magic string to indicate that it is not your ordinary component? You will. Naturally, almost anything can be used in ways it should not be. But when you are combining the dominant SPA framework, blurring the lines between the front and back ends, and employing a large amount of fairly complex magic behind the scenes to make it happen, I get the sense that bad things may be afoot. I for the moment am content working with a different framework, it's been smooth sailing for a complex enterprise system. I'll see how the rest of this unfolds from afar.
- teaearlgraycold 3y agoI’m currently wondering if I should switch to Vue or something else because of “use server”
- theflyinghorse 3y agoYou can do what many of us do and simply use reactjs. Despite the hype you dont have to use next, and frankly i would advise against using next
- teaearlgraycold 3y agoI do really like some of their features. Any recommendations for how I can check for a cookie presence before hitting any react code and redirecting to a login screen without a content flash?
- jsunderland323 3y agoIt looks like you’re basically sending raw c code to an express server then evaling it with some zig module import. Is that correct? Seems super safe.
- randomdev3 3y agoThe amount of complexity they add with all combinations or render modes, caches and abstraction layers is incredible. For most webapps you can just ship html or create SPA and it's fast enough. If shipping 30kB of js on first load is an issue, then send plain html. I tried nextjs and for a simple site with few pages and echo endpoint it creates like 2MB of javascript. I could make the same result in 100 lines of code but apparently it's not fast or modern. The issue is that static file hosting and effective servers don't generate money for infra providers. So better run some js cluster** to get a login form for client.
- deleted 3y ago[deleted]
- erulabs 3y agoI'm a devops engineer and so am plenty comfortable building APIs, but I use next.js for front-end stuff, effectively as a more powerful "create-react-app". However, I dislike having to caution-tape over the server-side of nextjs, and I dislike having to build my own https wrapper every time etc. Is there a good / popular front-end focused nextjs alternative that doesn't make it a massive pain in the butt to crank out a react app? Am I doomed to make my own create-react-app wrapper?