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

Can you adjust the example by adding the client side build too, and hydration? #1

Closed
valentinvieriu opened this issue Sep 30, 2020 · 8 comments

Comments

@valentinvieriu
Copy link

Hi Tobias, I've watched closely vitejs/vite#711, and tried to replicate that setup, but somehow I'm missing some steps. The example here is not even close to the findings in the above mentioned issue.

Is it possible to adapt this example to showcase a full SSR ( with client side hydration) example with Vite?

This would be much appreciated, as this is not mentioned anywhere at this moment.

Thank you

@tbgse
Copy link
Owner

tbgse commented Sep 30, 2020

hi @valentinvieriu it turns out there are still a few more moving parts that seem to be work in progress in vite as well as rollup to make SSR happen correctly. Those pieces are slowly coming together. See this issue here: vitejs/vite#764 and at rollup here rollup/rollup#3760 and rollup/rollup#3764

There is a workaround mentioned in the vite issue as well that I tried out and it seemed to work well enough. Expanding this example is a good idea, I'll try to find time to do this in the next days.

@valentinvieriu
Copy link
Author

valentinvieriu commented Sep 30, 2020

Thank you for the quick reply.
I have some question that maybe you can help if you have the time:

If I do the steps above, I get the server build only on vite but on vite build i only get the client build.

I must say I've got lost at lower level than the one you probably are. I'm still trying to get the real basic going

I will continue to monitor this repo then, for your updates.

Thank you again for your clarifications

@tbgse
Copy link
Owner

tbgse commented Sep 30, 2020

I just updated the example, your questions should be answered by looking at the code.

The custom build section is its own file that we will run as npm script with npm run build instead of vite build (see package.json in the code). Just like you said, you'd need to replace the reference to the js file in the index.html.

This is all still more of a proof of concept than anything that could actually be used in production. Let me know how far you can get from here and if you end up running into issues.

@valentinvieriu
Copy link
Author

@tbgse thank you very much for your quick response. Now that I look backwards, it makes sense, but when I was in the middle of the challenge, I kept thinking that this custom build, needs to be somehow part of vite ecosystem.
Thank you for clarifying this and modifying the code. This is already a good start
I'm actually trying to adapt this build process, to work with Cloudflare Workers, so I'll have to adapt the SSR Build code to work in a webworker like env that exists inside a Cloudflare Worker
Feel free to join/ check https://vueflare.com/
Thank you again for your fast response

@tbgse
Copy link
Owner

tbgse commented Oct 1, 2020 via email

@valentinvieriu
Copy link
Author

This is funny indeed. Please join me then on building VueFlare. I've just created the organization yesterday and bought the domain name. I was also inspired by React Flare.
I've actually build couple of projects in the past based on @l5x vue-ssr-cloudflare-workers-template and really see some interesting potential here with Cloudflare Workers

@tbgse
Copy link
Owner

tbgse commented Oct 1, 2020

happy to join forces on this @valentinvieriu maybe let's set up a discord / chat to have a more detailed discussion around the objectives etc.

@frandiox
Copy link

frandiox commented Oct 4, 2020

@valentinvieriu @tbgse Hi! I've been following SSR related issues to make this work in CF Workers for a while as well 😅
Do you mind if I join you?

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

No branches or pull requests

3 participants