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

Make it generic? #51

Open
brillout opened this issue Jan 29, 2025 · 4 comments
Open

Make it generic? #51

brillout opened this issue Jan 29, 2025 · 4 comments

Comments

@brillout
Copy link
Member

vike-node supports these server frameworks: https://github.com/vikejs/vike-node#supported-servers.

Can we make vike-node generic so that it can take any server entry ./path/to/server/index.ts as argument? So that it becomes more like a drop in replacement for ts-node.

In addition, we can have vike-{express,hono,fastify,...} for seamless integration (powered by universal-middleware).

CC @magne4000 @rtritto

Labeling this as low-prio because vike-{express,hono,fastify,...} are more important (they are crucial for the Stem vision). But it's good to have this nice-to-have-goal on the radar since we're currently refactoring the whole server integration.

@magne4000
Copy link
Member

I'll probably tackle this subject myself, as it's closely tied to universal-middleware.

@rtritto
Copy link
Contributor

rtritto commented Feb 9, 2025

we can have vike-{express,hono,fastify,...} for seamless integration (powered by universal-middleware)

The Vite (dev) logic will be splitted into separated packages:

  • vike-{express,hono,fastify,...} → will be used in the development and in the production; the universal-middleware needs also to be refactored to use separated packages (eg universal-middleware/{express,hono,fastify,...})
  • vike and vike-{node,...} → will be used in the development and to bundle (build step)

To reduce the confusion, a good idea is to use a different naming convention for the packages to create a difference between dependencies and dev dependencies: eg @vike/{express,hono,fastify,...} can be used for dependencies and vike-{node,...} for dev dependencies.

@brillout
Copy link
Member Author

create a difference between dependencies and dev dependencies: eg @vike/{express,hono,fastify,...} can be used for dependencies and vike-{node,...} for dev dependencies.

Again, splitting packages into dev/prod packages is a non-goal and a DX no-go.

@rtritto
Copy link
Contributor

rtritto commented Feb 10, 2025

Again, splitting packages into dev/prod packages is a non-goal and a DX no-go.

The vike/vite code should not run in the production bundle.

This point can be achieved with splitting the code (with dynamic imports) and package and/or with building the code. Idk if there are other ways.

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

No branches or pull requests

3 participants