-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[Question] Does SSR with Vue really need a build? (i.e. Handle component files like Ts-Node) #1122
Comments
That can be do. But most case we need fast performannce at runtime, vue template always need tranformed (this is what |
@underfin its not a performance issue, as in TsNode, the compiled code is cached after the first run. |
Yeah. That always need tranformed at runtime whaterever cached or not cached. |
@underfin In a way different than ts-node? If so, why? |
If you want to run it by the similar way of This question same as |
What I'm trying to say is that This is accomplished because the FIRST time any I believe that we could do the same with The advantages being:
Can we keep this open as a suggestion please? I believe it needs more feedback. @underfin |
This is a nice point, it can be faster with ssr hmr .But I also think need build for production. I reopen this hope get other people give opion. |
@arpowers Very interesting idea. It could be useful at least for development in order to have a local SSR environment that doesn't require build watching, like what you mentioned in another issue. In production, however, I think a build would still be better at least for short-lived environments such as serverless functions or workers. Maybe it could be fine for Node servers 🤔 |
Closing for #1290 |
Since SSR is essentially just rendering a "snapshot" of the initial state of the HTML generated by components, shouldn't it be possible to handle component files in a similar way to how ts-node deals with
.ts
files?Essentially we could use require.extensions to convert
.vue
files to es modules, add a .ts extension and then handle them withts-node
... giving us the ability to use Vue components without the hassle of a build.I know, for some reason, Node says not to use this but it's a critically useful feature when implemented carefully (as with
ts-node
)The text was updated successfully, but these errors were encountered: