179 points · by ChrisArchitect · 5y ago · 71 comments
I work on a no-code visual page builder for React-based sites like this (https://www.plasmic.app) - a major customer segment is headless commerce sites, so this is something we care a lot about.
[1]: https://shopify.dev/api/hydrogen/framework/react-server-comp...
[2]: https://github.com/vercel/next-rsc-demo
[3]: https://nextjs.org/blog/next-12#react-server-components
The key to unlocking fast first-render is combination of streaming SSR (i.e. streaming HTML instead of just JS blobs), which is enabled by adopting Suspense (i.e. async the data fetch and stream data when available in HTML response, which then hydrates relevant component). RSC layers on top: it establishes a clear boundary between client and server logic, which enables better bundling strategies (as you highlighted), but also per-component and efficient subtree updates for subsequent interactions.
RSC is early but we've been working with the React core team on our use case and, based on the past few months of work and progress, we feel pretty confident about the direction. In particular, shifting legacy React apps towards Suspense+RSC will be a big shift for many, but we don't have that constraint.. We have the "luxury" of starting anew and we're leaning into the bleeding edge because it enables all the right primitives for commerce: fast first render, efficient updates, open space for optimizing bundles and RSC transport protocol, etc.
Not on you, but this move (to RSC) looks like an absolute mess. All you're trying to do is render some HTML, CSS, and JavaScript to the browser. This is over-engineering at its finest. Looking at the demo repo gave me the shakes.
In that scenario, reducing bundle size and network requests can achieve a comparable (if not better) result while preserving code ergonomics. Speaking at least to the demo repo linked above, it looks like API ergonomics were an afterthought and pleasing the benchmark was first priority.
There are several other things that are specific to Hydrogen that will likely change during the dev preview period as React introduces new features (like server context and SSR with RSC).
I guess we millennials are coming of age.
But the FAQ says:
Is there a developer API? Not yet. Once we reach General Availability for WebContainer we plan to release an API surface.
Is this open source? Today no, but the API will be open source to developers at GA.
The closest I can find from Stackblitz is this Github issue where the Stackblitz founder 4 years ago responds to "By any chance, are you open-sourcing the codebase?" with:
Definitely! We're planning on open sourcing the core tech behind stackblitz (which is what this repo is for), but there's a lot that needs to happen between now & then. I'm going to fill out the readme a bit which should answer this in detail — will circle back shortly.
https://github.com/stackblitz/core/issues/28#issuecomment-32...
To what extent is the Stackblitz or even underlying WebContainer tech open source / documented?
In regards to my comment 4 years ago, this was in reference to our v1 technology toolchain (turbo npm client, etc) which is all available as open source over at https://github.com/stackblitz/core.
In regards to WebContainer, it's still very much in beta and undergoing many internal API changes as we iterate, but we absolutely intend to release an OSS API once we hit GA.
Our current docs/developer portal has some additional API/config information on StackBlitz, WebContainer, etc (albeit still WIP): https://developer.stackblitz.com/
I get that the shopify components expect to receive shopify-format data, but are there other restrictions we should understand? The docs do say Hydrogen apps can hit 3rd-party API's, so how do we think about the dividing line between what Hydrogen can and can't do?
Though we're exploring the use of Hydrogen + React Native > Android/iOS.
This move was needed - shopify's themes were one of it's weakest links, in my experience - but if I had a competing service I'd be looking at this with dollar signs in my eyes.
It never really gained traction but I'm curious if anyone else remembers.
Moving away from it into ReactJS felt like taking a huge step backwards in terms of capabilities and speed.
It's a bummer it's not more popular.
Ascribing non-malicious intentions to Shopify, it seems their success has equally gone to their heads as it has gone to all the other tech companies, who have been inexcusably allowed to accumulate power far beyond what should have ever been permitted.
We must start insisting on that people's rights simply cannot be abused because a corporate entity claims to have more rights to choose than a private person. The standard for antitrust should be that if there are no alternatives for legal products and services in an industry, it is a clear sign that a monopoly exists and the companies must be broken up or must fund competitors until a state of equilibrium and rights are restored.
The standard for anti-trust is that the company must behave in an anti-competitive way. I think this probably makes more sense.
We even use our own Payment processor!
Be careful with Shopify, they will pull the rug out from under you and there is nothing that can be done. I don't recommend building a platform on top of this.
If you built your own shopping mall, you could decide whether or not to allow a Hooters on the property. This seems pretty fair to me.
I am directly stating this is a problem; I don't really think I understand your rebuttal. I agree such a platform assumes a massive amount of control over your business, but I find it highly disagreeable both that this is the way platforms behave, and that this is legally permissible.
Indeed, your analogy is as if the "mall" would allow Hooters on the property for 5 years, and then without recourse to the resident Hooters be allowed to nullify their lease & expunge their business overnight, without an authority to speak to nor legal protections against this eviction, which predictably was the entire lifeblood of the franchise as this "mall" was offering interesting web tricks like "available all over the globe with no need for redundancy".
Seems like a big problem no? By moving to the web, platforms assume even more control with far less regulation over your business than your landlord ever could dream of. Yikes.