Use Vite for server side rendering in Node
MIT License
Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.17.1...v0.17.2
Published by frandiox over 1 year ago
package.json
during build by @frandiox in https://github.com/frandiox/vite-ssr/pull/189
Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.17.0...v0.17.1
Published by frandiox over 1 year ago
We've skipped Vite 3 so please check migration guides from v2 to v3 and then to v4.
Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.16.0...v0.17.0
Published by frandiox over 2 years ago
package.json
-"react-router-config": "^5.0.2",
-"react-router-dom": "^5.2.0"
+"react-router-dom": "^6.2.2"
App.jsx
-import { Link, Route, Switch } from 'react-router-dom'
+import { Link, Route, Routes } from 'react-router-dom'
- <Switch>
+ <Routes>
{router.routes.map((route) => {
return (
- <Route key={route.path} path={route.path}>
- <route.component route={route} baseUrl={baseUrl} />
- </Route>
+ <Route
+ key={route.path}
+ path={route.path}
+ element={<route.component route={route} baseUrl={baseUrl} />}
+ />
)
})}
- </Switch>
+ </Routes>
Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.15.0...v0.16.0
Published by frandiox almost 3 years ago
url
object passed in context is always type URL
(before it was type Location
).base
is provided under some conditions.127.0.0.1
instead of localhost
in macOS to prevent Vite issues.$1
. Related #123pluginOptions.containerId
to customize the container element ID in index.html
.Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.14.3...v0.15.0
Published by frandiox almost 3 years ago
excludeSsrComponents
option in the plugin to remove components from the SSR build. Components are mocked and will render nothing in SSR but will be hydrated later in the browser. This allows having a smaller server build for constraint environments like Cloudflare Workers.Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.14.2...v0.14.3
Published by frandiox about 3 years ago
\n
, etc).Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.14.1...v0.14.2
Published by frandiox about 3 years ago
Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.14.0...v0.14.1
Published by frandiox about 3 years ago
@vite/plugin-react
Full Changelog: https://github.com/frandiox/vite-ssr/compare/v0.13.2...v0.14.0
Published by frandiox about 3 years ago
Published by frandiox about 3 years ago
Published by frandiox about 3 years ago
index.html
#88build.serverOptions
and build.clientOptions
in the plugin.Published by frandiox about 3 years ago
keepIndexHtml
build option.Published by frandiox about 3 years ago
createSsrServer
from vite-ssr/dev
to support running dev server as middleware.styled-components
and @material-ui/core
has been refactored into a more extendable solution called Style Collector plugins. Instead of detecting CSS-in-JS automatically like before, now you must provide a styleCollector
option. Vite SSR exports style collectors for the 2 existing integrations, styled-components
and material-ui-core-v4
, plus the newly added emotion
. See style collector examples to implement your own. Example using one of the 3 provided collectors:import viteSSR from 'vite-ssr/react'
import styleCollector from 'vite-ssr/react/style-collectors/styled-components'
export default viteSSR(App, { routes, styleCollector })
Published by frandiox about 3 years ago
getRenderContext
.Published by frandiox over 3 years ago
Context
type.Published by frandiox over 3 years ago
public
to dist/server
.Published by frandiox over 3 years ago
useContext
utility to access the SSR context (initialState
, etc) from anywhere.redirect
and writeResponse
utilities to change response headers and status. #55outDir
were ignored. #53 #62request
and response
object. #54vite-plugin-legacy
. #63 #58Published by frandiox over 3 years ago
vite-ssr/vue
and vite-ssr/react
to improve typings.