Comments (10)
It will be implemented before the 1.0.0
👍
from nuxt.js.
I think providing a stream handler callback will be very useful.
Consider the following scenario:
Although Vue.js has a component based cache mechanism, it has several problems:
- Still need to enter the render process.
- Too complicated. One URL corresponding to one cached html file is more straightforward.
So I want to implement a vue independent cache system. If Nuxt could provide a hook to let me handle the stream, It will be very nice!
from nuxt.js.
Good to mention that according to vue ssr docs streaming is not recommended as we need to evaluate all async components in order to prepare complete headers. So it may introduce performance downsides! (This is actually not opposite to @fenivana's approach since it is streaming the cached response not during response generation :)) )
Since a lot of the context information (like head information or inlined critical CSS) needs to be appear before the application markup, we essentially have to wait until the stream to complete before we can start making use of these context data.
It is therefore NOT recommended to use streaming mode if you rely on context data populated by component lifecycle hooks.
from nuxt.js.
It was actually to make the code more easy to read and to start with (mostly for the renderRoute function).
Now that Nuxt.js will be soon released in V1, I don't see any inconvenient to use the streams to send back the HTML to the server!
from nuxt.js.
Awesome! This mechanism is very helpful for websites with many user-generated-pages!
from nuxt.js.
How to build rest apis in nuxt js,
let say i have a form, i wanted to store from data to database using a rest api, how do i achive this
from nuxt.js.
@slrohit This is out of the job scope of NUXT. NUXT should be just about server-side rendering.
API should be implemented in a separate server, or a middleware if you are using NUXT as a middleware.
from nuxt.js.
@slrohit I recently used https://github.com/zeit/micro for building a rest api, maybe have a look at that repo. Your usecase has nothing to do with NUXT
as @f15gdsy mentioned above.
from nuxt.js.
v1.0 seems to be released soon. Where should I see to know actually Nuxt.js makes use of streaming SSR?
from nuxt.js.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from nuxt.js.
Related Issues (20)
- When starting up in the development environment, more information streams should be displayed HOT 2
- Better Error Messages when Using Layers HOT 2
- "Unexpected token ';'" error when running the build. HOT 9
- propsDestructure no longer working HOT 7
- theme-color meta tags are incorrectly deduped HOT 3
- Issue deploying in Cloudflare Pages with SSR enabled (Error: Failed to publish your Function. Got error: Unknown internal error occurred) HOT 1
- Scroll behavior Bug introduced wit PR 28083 HOT 4
- When running pnpm dev, Unable to automatically get environment variables from `.env.local` and `.env.development` HOT 3
- Allow `baseURL` with relative path in `nuxt.config.ts`
- SSR set cookie in Safari is not working HOT 1
- Firebase CLI deploy create an index.html in .output/public preventing website to be displayed properly
- useFetch with prerenderRoutes of endpoint double-hydrates with error (Nuxt Generate)
- Allow `:fallback="true"` for <client-only> to render same component server side ignoring the "hydration mismatch"
- Cannot access '_sharedRuntimeConfig' HOT 1
- Nuxt 3 not rendering in SSR HOT 1
- Hydration error if <ul> or <ol> is within a <p> block HOT 1
- The props of `PublicRuntimeConfig` are inferred as `unknown`
- Catch-all page route gives error when using nuxtApp under setup HOT 2
- v-html and dynamic component not working server-side HOT 5
- How to fix nuxt redirect to homepage on hard refresh and direct access to any page? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.js.