nksaraf / vinxi

The Full Stack JavaScript SDK
https://vinxi.vercel.app
MIT License
2.19k stars 80 forks source link

feat: allow custom HMR configuration #404

Open schiller-manuel opened 1 month ago

schiller-manuel commented 1 month ago

fixes #394

codesandbox[bot] commented 1 month ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 6cb0bf96efb89fb0e5535f5bbe6fb78cbf26401a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------- | ----- | | vinxi | Patch | | @vinxi/router | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vinxi-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 5:30pm
pkg-pr-new[bot] commented 3 weeks ago

Open in Stackblitz

@vinxi/deno-doc

``` pnpm add https://pkg.pr.new/@vinxi/deno-doc@404 ```

vinxi

``` pnpm add https://pkg.pr.new/vinxi@404 ```

@vinxi/plugin-directives

``` pnpm add https://pkg.pr.new/@vinxi/plugin-directives@404 ```

@vinxi/doc

``` pnpm add https://pkg.pr.new/@vinxi/doc@404 ```

@vinxi/plugin-mdx

``` pnpm add https://pkg.pr.new/@vinxi/plugin-mdx@404 ```

@vinxi/openapi

``` pnpm add https://pkg.pr.new/@vinxi/openapi@404 ```

@vinxi/react

``` pnpm add https://pkg.pr.new/@vinxi/react@404 ```

@vinxi/react-server

``` pnpm add https://pkg.pr.new/@vinxi/react-server@404 ```

@vinxi/router

``` pnpm add https://pkg.pr.new/@vinxi/router@404 ```

@vinxi/server-components

``` pnpm add https://pkg.pr.new/@vinxi/server-components@404 ```

@vinxi/server-functions

``` pnpm add https://pkg.pr.new/@vinxi/server-functions@404 ```

@vinxi/solid

``` pnpm add https://pkg.pr.new/@vinxi/solid@404 ```

commit: 6cb0bf9

schiller-manuel commented 3 weeks ago

I am unsure whether this works as the vite config is not passed into createViteHandler, right?

nksaraf commented 1 week ago

We create several instances of vite, based on how many routers are created, and they each need a unique HMR port, thus by default we randomize it. We could allow people to specify the hmr port for a given router, but we can't really do one HMR port for the whole app

schiller-manuel commented 1 week ago

sounds good, a port per router