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

Like Next.js but without SSR #11

Open
egoist opened this issue Jan 13, 2020 · 7 comments
Open

Like Next.js but without SSR #11

egoist opened this issue Jan 13, 2020 · 7 comments
Labels
open-source-library Feel free to work on it unless someone else has claimed it

Comments

@egoist
Copy link
Owner

egoist commented Jan 13, 2020

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

@egoist egoist added the open-source-library Feel free to work on it unless someone else has claimed it label Jan 13, 2020
@manniL
Copy link

manniL commented Jan 13, 2020

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

@egoist
Copy link
Owner Author

egoist commented Jan 13, 2020

@manniL Yeah I opened an issue nuxt/nuxt#6862

@egoist
Copy link
Owner Author

egoist commented Jan 13, 2020

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

@djyde
Copy link

djyde commented Jan 13, 2020

sounds like serlina.js.org

@egoist
Copy link
Owner Author

egoist commented Jan 13, 2020

@djyde Only if it meets these requirements:

  • Allow me to disable SSR so I don't have to write SSR-compatible code
  • Allow me to have API pages
  • Framework-agnostic front-end pages (this should be easy to implement when the framework doesn't need to worry about SSR)

@quyctd
Copy link

quyctd commented Dec 19, 2021

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

  • NextJS without SSR, isn't it the same as React?
  • I don't get the idea behind disabling SSR and allowing API pages. I think API pages cannot work without SSR?

@egoist
Copy link
Owner Author

egoist commented Dec 19, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-library Feel free to work on it unless someone else has claimed it
Projects
None yet
Development

No branches or pull requests

4 participants