Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The Full Stack JavaScript SDK

License

NotificationsYou must be signed in to change notification settings

liuhui1999/vinxi

 
 

Repository files navigation

The Full Stack JavaScript SDK to build full stack apps and frameworks with your own opinions.
powered byvite andnitro

vinxi

Compose full stack applications (and frameworks) usingVite, the versatile bundler and dev server, andNitro, the universal production server. The core primitive invinxi is arouter.

Inspired by theBun.App API.

  • Routers are handlers that tell us how specific URLs should be handled. We support various router modes: "static", "spa", "http", (and new ones can be added). Routers specify the handler file (entrypoint) to use for theirbase-prefixed routes. They can also specify adir andstyle in some router modes to include a file system router that is provided to the handler. Routers specify their bundler configuration, via thebuild property. The routers tell the bundler what entry points to build, what vite plugins to use, etc.

Examples

FrameworkCategoryExampleStackBlitz Link
ReactRSCSPAOpen in StackBlitz
SPABasicOpen in StackBlitz
MDXOpen in StackBlitz
TanStack Router (Pages)Open in StackBlitz
TanStack Router (App)Open in StackBlitz
WouterOpen in StackBlitz
SSRBasicOpen in StackBlitz
Basic w/CloudflareOpen in StackBlitz
TanStack Router (App)Open in StackBlitz
WouterOpen in StackBlitz
SolidSPABasicOpen in StackBlitz
SSRBasicOpen in StackBlitz
Solid RouterOpen in StackBlitz
VanillaSPAOpen in StackBlitz
TRPCOpen in StackBlitz

Goals

Primary goal is to build the tools needed to build a NextJS or SolidStart style metaframework on top of vite without worrying about a lot of the wiring required to keep dev and prod working along with SSR, SPA, RSC, and all the other acronyms. etc. On top of that, we should be able to deploy anywhere easily.

Mostly trying to disappear for the user outside the app.js file

The surface layer we are intending to tackle:

  1. Full stack builds (handle manifest stuff to figure out what assets to load at prod runtime)
  2. Dev time asset handling (avoiding FOUC in SSR frameworks) and smoothing over some of vite's dev/prod mismatching behaviours by providing common manifest APIs that work in dev and prod the same way
  3. File system router (not any specific file system conventions, just an API for interfacing with FileSystemRouters and utils to implement your conventions in them)
  4. Building the server, and providing a simple opaquehandler API to control the server
  5. Adapter stuff to deploy to various platforms with support for all the features they provide
  6. Not to abstract away the platforms. Let people use what they want to the fullest
  7. Have little opinion about how the app should be authored or structured

Roadmap

  • vinxi deploy
  • hooks throughout the app licycle:
    • dev: app:created, app:started, router:created

Try it out

npm install vinxi

React SSR

importreactRefreshfrom"@vitejs/plugin-react";import{createApp}from"vinxi";exportdefaultcreateApp({routers:[{name:"public",type:"static",dir:"./public",},{name:"client",type:"client",handler:"./app/client.tsx",target:"browser",plugins:()=>[reactRefresh()],base:"/_build",},{name:"ssr",type:"http",handler:"./app/server.tsx",target:"server",},],});

Solid SSR

import{createApp}from"vinxi";importsolidfrom"vite-plugin-solid";exportdefaultcreateApp({routers:[{name:"public",type:"static",dir:"./public",},{name:"client",type:"client",handler:"./app/client.tsx",target:"browser",plugins:()=>[solid({ssr:true})],base:"/_build",},{name:"ssr",type:"http",handler:"./app/server.tsx",target:"server",plugins:()=>[solid({ssr:true})],},],});

About

The Full Stack JavaScript SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript71.0%
  • TypeScript26.6%
  • CSS1.8%
  • Other0.6%

[8]ページ先頭

©2009-2025 Movatter.jp