egoist / ideas

💡ideas / thoughts / polls from egoist
101 stars 2 forks source link

Like Next.js but without SSR #11

Open egoist opened 4 years ago

egoist commented 4 years ago

The idea

Next.js for building single-page app (client rendering only)

I love that you can use Next.js to develop your frontend pages/*.tsx and api pages/api/*.ts at the same time in a single project, but it's also quite annoying that Next.js requires your frontend code to be SSR compatible even if you don't need any of those SSR features.

Alternatives

manniL commented 4 years ago

Might be a good chance to contribute to the alternative then? 🤔😋

egoist commented 4 years ago

@manniL Yeah I opened an issue https://github.com/nuxt/nuxt.js/issues/6862

egoist commented 4 years ago

What I want is actually a framework-agnostic solution, more like making Poi or Parcel support file-system based routes.

djyde commented 4 years ago

sounds like serlina.js.org

egoist commented 4 years ago

@djyde Only if it meets these requirements:

quyctd commented 2 years ago

@egoist Nice idea. I think Next should support disabling SSR too. But I have some questions about this idea:

egoist commented 2 years ago

@quyctd

NextJS without SSR, isn't it the same as React?

Technically yes, but it's much more convenient than vanilla react spa, you get file-system routing for free and many other neat features.

btw in Next.js there is a way to disable SSR for certain components: https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr so we don't need to worry about this

I don't get the idea behind disabling SSR and allowing API pages. I think API pages cannot work without SSR?

I meant the SSR for regular react pages can be disabled, you can still have a server for API pages.