router icon indicating copy to clipboard operation
router copied to clipboard

examples: add a basic vinxi example.

Open MAST1999 opened this issue 1 year ago • 7 comments

MAST1999 avatar Jan 12 '24 23:01 MAST1999

If we want to add server functions via use server, you should use @vinxi/server-functions which is an ootb way to add use server support in any Vinxi app

nksaraf avatar Jan 13 '24 14:01 nksaraf

If we want to add server functions via use server, you should use @vinxi/server-functions which is an ootb way to add use server support in any Vinxi app

Got it, I'll look into it tonight.

BTW, what does ootb stand for?

MAST1999 avatar Jan 13 '24 15:01 MAST1999

https://github.com/nksaraf/vinxi/blob/main/examples/solid/ssr/basic/app.config.js

Ootb -Out of the box

nksaraf avatar Jan 13 '24 16:01 nksaraf

Added @vinxi/server-functions as Nikhil suggested.

MAST1999 avatar Jan 13 '24 21:01 MAST1999

So, I spent some time with @nksaraf and adapted this example into an SSR w/ streaming example. I just committed that example into the repo as vinxi-basic-ssr-streaming.

If you can, please take a look at some of the code and, for the pieces that make sense, adapt it to this one. I think the most important distinction to make here is that we likely need a few examples for vinxi:

  • vinxi-basic (client rendering + server functions)
  • vinxi-basic-ssr (server rendering + server functions)
  • vinxi-basic-ssr-streaming (server rendering + streaming + server function. This is the one I just committed)

Not sure where you want to land with this example (either basic or basic-ssr), so let me know what you're planning.

tannerlinsley avatar Jan 16 '24 23:01 tannerlinsley

So, I spent some time with @nksaraf and adapted this example into an SSR w/ streaming example. I just committed that example into the repo as vinxi-basic-ssr-streaming.

If you can, please take a look at some of the code and, for the pieces that make sense, adapt it to this one. I think the most important distinction to make here is that we likely need a few examples for vinxi:

* vinxi-basic (client rendering + server functions)

* vinxi-basic-ssr (server rendering + server functions)

* vinxi-basic-ssr-streaming (server rendering + streaming + server function. This is the one I just committed)

Not sure where you want to land with this example (either basic or basic-ssr), so let me know what you're planning.

I can try to implement both client/server rendering + server functions examples.

I'll try to write it up over the weekend.

MAST1999 avatar Jan 16 '24 23:01 MAST1999

It seems like what you have here is basically already the client only + server functions example, right?

tannerlinsley avatar Jan 17 '24 00:01 tannerlinsley

So the one I had also had SSR.

I added a client only with server functions as well.

So now we have these:

  • Client only with server function -> vinxi-basic
  • SSR with server function -> vinxi-basic-ssr
  • SSR with streaming -> vinxi-ssr-streaming

I also updated the package names.

MAST1999 avatar Jan 17 '24 02:01 MAST1999