Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solid Start Comparison #96

Open
brillout opened this issue Jun 24, 2024 · 3 comments
Open

Solid Start Comparison #96

brillout opened this issue Jun 24, 2024 · 3 comments

Comments

@brillout
Copy link
Member

A comparison of features could be neat.

To give confidence to users that vike-solid supports Solid Start features.

Also for us, so what we know where vike-solid is lacking compared to Solid Start.

@magne4000
Copy link
Member

Then we'll pick which features of solid-start are worth implementing in vike-solid

@ailectra
Copy link

ailectra commented Jul 23, 2024

I did a preliminary comparison table based on the one for NextJS:

Feature Vike Next.js SolidStart
Bundler Vite (dev: esbuild+ESM, prod: Rollup) Webpack Vite
UI Framework Any (React, Preact, Solid, etc.) React only SolidJS only
Code-splitting and bundling Yes Yes Yes
HMR Yes, fast Yes, slow Yes, fast
Optional SSR Yes Limited (app[1], pages[2][3], components[4][5]) Yes

SSR

Control Full control Limited / Black box Full control
Renderers Yes, create as many you need Just one (_app.ts file) Single renderer, customizable
RSC (React Server Components) Yes, partially Yes, experimental N/A (uses different approach)

Routing

Filesystem Routing Yes Yes Yes
Yes No Yes
Yes Yes, but limited in SPA-only mode *** Yes
Yes No Yes
Custom Router Configuration Yes No Yes
Yes Limited Yes

Pre-rendering (SSG)

Pre-rendering (SSG) Yes, for pages Yes, for pages, or components (Partial Pre-rendering using RSC) Yes, for pages
Incremental Static Regeneration (ISR) No*, use Yes, in the Node.js runtime, on Vercel Not built-in, but you can use Nitro Route Rules on Vercel (other Deployment platforms such as CloudFlare involve more manual setup)
SPA-only mode (popular for PWAs) *** Yes Limited: no dynamic routing in App Router Yes

Server Capabilities

Server Functions No*, recommended to use Telefunc Yes Yes
API Routes No*, use your server or an RPC tool Yes Yes

Integrations

HTTP server No*, bring your own Baked-in, custom server partially supported with caveats[1][2]
Apollo Client with SSR Fully supported Partially supported
Relay with SSR Fully supported Partially supported

Extras

Head component No*, use a tool like react-helmet. Yes, next/head Yes, built-in Meta component
Image component No*, use an image optimizer tool. Yes, next/image No, use external libraries
Internationalization (i18n) Yes Limited Supported via external libraries
Yes No No
Build your own framework Yes No Yes
Advanced Features
HTML Streaming Yes Yes Yes
Islands Architecture No, requires manual setup No Yes (experimental)
Transitions Yes Yes Yes

Deployment options

Vercel Yes, minimal config Yes, zero config Yes, with adapter
Cloudflare Workers Yes, minimal config Yes, but limited Yes, with adapter
Node server (Docker, Heroku, Digital Ocean etc.) Yes, minimal config Yes, but limited Yes
Caching (see own section above) No*, if needed, use industry-standard caching** App Router caching, opt-out Supports key-based cache/invalidation

(*) Vike doesn't ship those extras by design.

(**) Industry-standard ways of caching is to use the HTTP Cache-Control header to cache in the client's browser and potentially also on a shared/public CDN cache in front of your server side. Additionally, if you ever need even more caching than that, it's possible to have an in-memory cache on your server-side using e.g. Redis or Memcached.

(***) SPA-only mode means you make a static export of your app, into HTML, CSS and JS files, and serve them from a CDN, which means you don't need any server compute on requests (as opposed to SSR).

Features I didn't put in the comparison table but that are interesting are:

  • Solid Router useBeforeLeave
  • You can pass a custom state in Solid Router useNavigate
  • The load function can be called when the Route is loaded or eagerly when links are hovered

@brillout
Copy link
Member Author

@ailectra Thanks!

Head component

It's work-in-progress. (There is already an implementation for vike-react which we can then port to vike-solid.)

Solid Router useBeforeLeave

Does it enable a use case that vike-solid doesn't support?

You can pass a custom state in Solid Router useNavigate

I don't see a use case for this?

The load function can be called when the Route is loaded or eagerly when links are hovered

It's work-in-progress: vikejs/vike#1617. (I'll finish & merge it after I'm done with the new head management.)


Beyond the work-in-progress on Vike's side, is there a use case Solid Start supports that Vike doesn't?

One neat thing about Solid Start is their research around server components / island architecture 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants