0.4.38 (2022-09-22)
- check bundle package duplicate only for production (59c832e)
0.4.37 (2022-09-22)
- fix exports (fix #457) (172fae9)
- improve single loaded version assertion (a97bc12)
- stop assuming single module instances (fix #460) (f0f4991)
0.4.36 (2022-09-19)
0.4.35 (2022-09-17)
0.4.34 (2022-09-14)
0.4.33 (2022-09-13)
0.4.32 (2022-09-08)
- comply to common reverse proxy setups (fix #443) (7b76001)
- improve error message upon trying to use
navigate()
without Client Routing (fix #441) (5c97cc4)
0.4.31 (2022-09-04)
0.4.30 (2022-09-02)
- use picocolors instead of kolorist (f4f2e1c)
0.4.29 (2022-08-30)
- support
includeAssetsImportedByServer
for linked dependencies (eaa857b) - use Vite's built-in
import.meta.glob()
instead ofvite-plugin-glob
(fix #431) (19385ef)
vite-plugin-ssr@0.4.29
doesn't work with Vite 2 anymore: make sure to update to Vite 3.
0.4.28 (2022-08-29)
0.4.27 (2022-08-26)
- improve
config.build.outDir
handling (d6415f8) - track instances for improved debuggability (6d24934)
- update vite-plugin-import-build (8856f94)
0.4.26 (2022-08-23)
- use latest vite-plugin-import-build version (4a2d3ea)
0.4.25 (2022-08-22)
- improve 404 logging during dev (522f8cc)
- improve React detection heuristic (#423) (bbd39c6)
- skip 404 warning upon
RenderErrorPage
error (45fd93f)
0.4.24 (2022-08-22)
0.4.23 (2022-08-21)
- rename
pageContext.url
topageContext.urlOriginal
(b2e7ff0)This fix contains a soft breaking change, see vite-plugin-ssr.com/migration/0.4.23.
0.4.22 (2022-08-18)
- add module
vite-plugin-ssr/routing
tooptimizeDeps.exclude
(3585d9e)
0.4.21 (2022-08-18)
- further tolerate vite-plugin-ssr being loaded twice (da02463)
- improve error message upon vite-plugin-ssr being included twice in bundle (58427f5)
- improve scroll restoration for Firefox (fd70fad)
- pass entire pageContext to Route Functions (a596b59)
- re-support & improve hash navigation (fix #418) (88b9da0)
0.4.20 (2022-08-12)
- fix types for react streaming (432d1a7)
- further tolerate vite-plugin-ssr being loaded twice (8038fbe)
- stop injecting into stream when streaming is disabled (#416) (a8e1519)
0.4.19 (2022-08-10)
- improve TypeScripts types (02c4089)
- implement
pageContext.isBackwardNavigation
(510501b)
0.4.18 (2022-08-05)
- don't swallow unexpected error upon prefetching (0e05293)
- improve error message upon duplicated page files (32bbdfd)
- improve error message upon failure fetching static assets (1d134a7)
- improve error message upon wrong provided
pageContext.url
value inonBeforeRoute()
(cb50a55) - upon
onBeforeRoute()
overwritingpageContext.url
, preserve and use original URL for.pageContex.json
requests (b9cca1b)
0.4.17 (2022-08-03)
0.4.16 (2022-08-01)
- improve
onBeforeRender()
hook handling upon error (5838c18) - support
build.assetsDir
(fix #397) (6909c8a)
0.4.15 (2022-07-31)
0.4.14 (2022-07-30)
- add
exportsAll
toPageContextBuiltIn
(06b0c6c) - add
is404
topageContext
docs andPageContextBuiltIn
(bcb2ab5) - add JSDoc annotations to
PageContextBuiltIn
(62dcc0e) - add support for server-side rendered preprocessed stylesheets (PostCSS, SASS, ...) (6d30acf)
- improve
vite-plugin-pwa
error message (#388) (6e6f872) - improve error message upon wrong base value (fix #394) (7671cfa)
- improve error message upon wrong outDir value (fix #392) (f2df3fe)
- improve error message upon wrong Rollup config (998e9f6)
- improve error message when trying to apply 's HTML transformer (fix #388) (2ab98c9)
- make onPagePrerender pageContext concurrent safe (ba11709)
- make React detection heuristic more robust (dfe45d3)
- remove problematic assertion (fix #391) (9500fe3)
- render error page on the client-side (fix #393) (9f2dfb7)
- show second error if it's not the same as first one (859678d)
- stop erasing previous
optimizeDeps.entries
(fix #386) (255e788) - stop executing
onBeforeRender()
hook upon rendering the error page (f992343) - support 404 for
$ vite preview
+ SSG (28f8e02)
0.4.13 (2022-07-26)
- forbiden re-exports in page files (6bd30c8)
- further improve error message upon wrong Vite config while using pre-rendering (#380) (013cb92)
- improve error message upon
prerender()
API usage with wrong Vite config (fix #380) (4084c5a) - remove wildcard re-export wrong usage assertion (db3c015)
- remove wrong assertion (fix #383) (928e12e)
- support dynamic
doNotPrerender
values (fix #382) (8a5b9a4) - support wildcard re-exports (fix #381) (64dc9a9)
- tell user to not define
doNotPrerender
in.page.client.js
files (5863a99) - use custom debug implemention instead of
debug
npm package (b4bdf62)
0.4.12 (2022-07-25)
- add export resolvers for TS (c995bfc)
- allow
_error.page.js
to be defined in_default/
(fix #374) (556b4b6) - allow
export { doNotPrerender }
to be defined in.page.js
and.page.client.js
(fix #378) (409b625) - explain user wrong usage instead of failing upon wrong export values (dd6e94e)
- false positive of using
pageContext.urlParsed.[hashString|searchString]
(fix #377) (c129b9e) - improve DEBUG=vps:extractStyles flag (#376) (5301336)
- improve error message upon wrong
onBeforePrerender()
hook usage (f533bda) - make
includeAssetsImportedByServer: false
work (099bc10) - make
includeAssetsImportedByServer
work for Vue SFCs (fix #376) (f4c57fb) - set
includeAssetsImportedByServer
tofalse
by default (d8aa9a5) - improve error messages (611bb45)
- load less page files while pre-rendering (611bb45)
- use
PageFile[exportNames]
while pre-rendering, in order to avoid unecessary loading of page files (#373, #378) (00db4f9)
0.4.11 (2022-07-22)
- assertion when user throws non-object error (7bad325)
- improve err msg upon production build not found (9aaa254)
0.4.10 (2022-07-20)
- show the stack trace for warnings with a direct call stack from the user (f5c22d4)
- treat
_default/
directories as empty for filesytem routing_default.page.*
files (da9af6e)
0.4.9 (2022-07-15)
- ensure that plugin helpers are not loaded by server-side runtime (48714f3)
0.4.8 (2022-07-15)
- add
node_modules/vite-plugin-ssr
tofs.allow
list (86b1173) - do not import
es-module-lexer
from server-side runtime (7420876) - do not import
fast-glob
from server-side runtime (0fabc6d)
0.4.7 (2022-07-15)
prerender()
types (a53c492)- avoid false warnings of outdated pageContext.pageExports usage (905f830)
- do not load route files when using server routing (0891002)
- eslint
prerender()
(f8f12b5) - show stack trace upon outdated pageExports usage (641f7d3)
- show viewport prefetching dev info only once (dae2e98)
0.4.6 (2022-07-14)
- improve page files to be scanned by Vite (31f4c01)
- prevent Vite from scanning too many page files (2772814)
0.4.5 (2022-07-12)
0.4.4 (2022-07-12)
0.4.3 (2022-07-12)
0.4.2 (2022-07-11)
- update URLs to https://vite-plugin-ssr.com docs (2fc1a3a)
0.4.1 (2022-07-11)
- add crossorigin attribute to preload link with absolute src (fix #355) (2c4ed4b)
- route precedence for new param token
@
(f83aa57)
0.4.0 (2022-07-10)
See vite-plugin-ssr.com/migration/0.4 for how to migrate from 0.3
to 0.4
.
Major feature: see this Twitter Thread.
Minor features:
- enable overwriting default routing with onBeforeRoute() (46b9e19)
- pageContext.urlParsed.searchAll (94ee761)
- Parameterized Filesystem Routing (416a94e)
- support export default (fix #314) (f653b68)
- add routing debug logs (dfdb208)
- add support for
$ vite preview
command (c8ca4b8) - add support for ReScript (a040fe7)
- add worker exports to
package.json#exports
for Cloudflare Workers (954fe02) - assert HTML variables (254cf54)
- do not append ?extractStyles to asset imports for image Vite plugins (fix #353) (1b937e2)
- do not copy static assets to
dist/server/
(7e33664) - ensure HMR preamble code to be executed before client entries (f4ff28b)
- ensure Rollup generates an entry for each page file (fix #350) (e659e26)
- ensure stream end handler is called once (768c383)
- ensure stream is always flushed (5770d9f)
- fix styling in development for browser back/fwd buttons (d3d4190)
- handle destroyed Node.js writable proxy (6488300)
- handle URLs with several trailing slahes (#310) (551b020)
- improve asset naming (8791d66)
- improve debug logs (978a7c2)
- improve error message upon multiple versions loaded (6bb206e)
- improve error message upon wrong streaming setup (baf8c88)
- improve filesystem routing when
pages/
is (deeply) nested (858dde4) - improve prefetch config (f4b4cc7)
- improve stream error handling (d4835c0)
- improve wrong usage error message (2d3132d)
- increase scroll listener throttle timeout (#46) (ab36ac3)
- isolate framework pageFiles symlink directory (6e2d6f1)
- make
$ vite dev
and$ vite preview
support HTML streaming (9a59360) - make
httpResponse.pipe()
work with Readable Streams (558f87a) - make
navigate()
cross-bundle safe (68a9e7a) - make vps resilient against array prototype extensions (2d09e75)
- only add vps dev middleware for Vite's CLI (b0c3974)
- route precendence (e2bfd5d)
- support
$ vite dev
command (4ca3e39) - support
vite preview
command for SSG (a7c602a) - support rollup format synonyms (1a7d4f7)
- swallow expected errors upon new frontend deploy (34d800f)
- switch to server-routing if asset fail to load upon new deploy (#292) (1f837d5)
- throw normalized client-side error upon new deploy handling (e0163a8)
- tolerate multiple vps instances (74b8eb2)
- treat
Object.ceate(null)
as plain JavaScript object (c9eb387) - update pageContext.urlParsed type (12261ac)
- ensure scripts to be loaded last (b921e60)
- only add page entries to
optimizeDeps.entries
if CI (8e10dae) - resolve dynamic imports early (a9da5a2)
- scan index page on dev start (4f82f03)
0.3.64 (2022-04-14)
- remove console.log() (32848a7)
0.3.63 (2022-04-14)
0.3.62 (2022-04-09)
0.3.61 (2022-03-30)
- Fix duplicate decodeURI logic (#291)
0.3.60 (2022-03-11)
- allow
prerender()
to be called without any argument (7eca89d) - forbid usage of older problematic Vite version (1b04a99)
- support unicode URLs (443f7c6)
0.3.59 (2022-02-23)
- help eslint resolve modules (fix #270) (14dfe7a)
- improve bug error message (#268) (a848d9d)
- improve error message upon wrong
escapeInject
usage (fix #268) (9331aa8)
0.3.58 (2022-02-20)
- fix windows dynamic import path resolve (c548f3e)
0.3.57 (2022-02-20)
0.3.56 (2022-02-19)
- [bundle-size reduction] remove unused utils from client (cb86e81)
- [npm package size reduction] remove tests from npm package (3ad6a6b)
- [npm package size reduction] replace dual ESM+CJS transpiling with (0157912)
0.3.55 (2022-02-18)
0.3.54 (2022-02-17)
0.3.53 (2022-02-10)
- add TypeScript types to CLI JavaScript API (b1d90c5)
0.3.52 (2022-02-10)
- pass
globalContext
toprerender()
hooks (0f52a77)
0.3.51 (2022-02-01)
- fix @brillout/json-s optimizeDeps entry (4e45d08)
- gracefully handle unexpected URL formats (fix #252) (48ca1b1)
- improve DX around wrong environement (4f705c4)
- use more robust Node.js env test (7240263)
0.3.50 (2022-01-28)
- enable users to trigger error page by
throw RenderPageError({ pageContext: /* some additional context passed to _error.page.js */ })
(8731c6e)
0.3.49 (2022-01-26)
- add
baseAssets
option; enable CDN deployments (dac4841)
0.3.48 (2022-01-25)
- fix and rename
doNotCreateNewHistoryEntry
tooverwriteLastHistoryEntry
(d3a4582)
0.3.47 (2022-01-24)
- new
navigate()
optiondoNotCreateNewHistoryEntry
(59460fd)
0.3.46 (2022-01-18)
- allow
render()
hook to return apageContext
promise (44ef89d)
0.3.45 (2022-01-17)
- allow user to define
rollupOptions.input
with astring
orstring[]
(d3f116d)
0.3.44 (2022-01-12)
- expose SSR errors at
pageContext.errorWhileRendering
(3a10f11)
0.3.43 (2022-01-04)
- enable improved SPA example (f111fd5)
0.3.42 (2021-12-27)
- attempt to fix the setup.ts bug (0ae3499)
0.3.41 (2021-12-24)
- add option
prerender({ onPagePrender })
(b864664)
0.3.40 (2021-12-23)
- do not use
outDir
config for plugindist/
folder (a7b2cc5) - improve error message when
importBuild.js
is missing (fix #235) (4390d7f) - replace direct eval with new Function (9432d31)
- support Cloudflare Pages workers (950b470)
0.3.39 (2021-12-18)
- add debug info for
setup.ts:14
bug (edad4cc)
0.3.38 (2021-12-18)
- make
noExternal: true
work with vite-plugin-ssr (bacba9f)
0.3.37 (2021-12-17)
- HTML tag detection regex (d8c3846)
- load stream module dynamically only if needed (beb589d)
- remove Vite's require hook plugin (55270db)
- HTML Streaming changes.
httpResponse.bodyNodeStream
->httpResponse.getNodeStream()
httpResponse.bodyWebStream
->httpResponse.getWebStream()
httpResponse.bodyPipeToNodeWritable()
->httpResponse.pipeToNodeWritable()
httpResponse.bodyPipeToWebWritable()
->httpResponse.pipeToWebWritable()
More infos at https://vite-plugin-ssr.com/stream
0.3.36 (2021-12-13)
- add support for relative URLs such as
./relative-path
or?query
(b0329d2) - deprecate
pageContext.urlNormalized
in favor ofpageContext.urlPathname
andpageContext.urlParsed
(2b23bf3)
pageContext.urlNormalized
is deprecated. UsepageContext.urlPathname
andpageContext.urlParsed
instead.
0.3.35 (2021-12-07)
- fix minor Base URL bug
0.3.34 (2021-12-04)
- filesytemRoutingRoot living at root (3f27e5d)
0.3.33 (2021-12-03)
- improve assert (d6bb445)
0.3.32 (2021-12-03)
0.3.31 (2021-11-19)
- don't assume Vite to noramlize
root
(fix #208) (3b50083) - fix client routing deadlock when ensureHydration is set (124c83c)
0.3.30 (2021-11-18)
- make
pageContext.pageProps.is404
more resillient (765c5b3)
0.3.29 (2021-11-16)
- add support for
url === '/some-base-url' && baseUrl === '/some-base-url/'
(bfac53b) - Client Router + Base URL regression (fix #205) (cb95ed4)
- improve argument handling of
useClientRouter()
(8db8836) - regression pageProps.is404 overriden by user provided
pageContext
(a796168) - skip Client Router for links that don't match Base URL (bce64c5)
0.3.28 (2021-11-15)
- add scss/sass/less to inferred types (fix #196) (0a329cf)
- always use camelCase for CLI options (2ad6027)
- fix buggy CSS test (8676afa)
- fix Route Function precendence value assertion (f4d41c7)
- improve error message when client-side routing to 404 (c036f51)
- show warning instead of internal error upon relative link URLs (83255e2)
- CLI option
$ vite-plugin-ssr prerender --no-extra-dir
renamed to$ vite-plugin-ssr prerender --noExtraDir
.
0.3.27 (2021-11-10)
0.3.26 (2021-11-05)
- do not normalize
pageContext.url
(22a5311)
0.3.25 (2021-11-05)
- fix wrong assert (4d4fa35)
0.3.24 (2021-11-04)
0.3.23 (2021-11-03)
- also render 500 page upon client-side routing (252137b)
- ensure right content type for
.pageContext.json
URLs (#191) (56e356f) - impl clear message when hooks wrongfully return whole
pageContext
object (fix #174) (c38eb98)
0.3.22 (2021-11-02)
- Add webp to inferred types (#195)
0.3.21 (2021-11-02)
0.3.20 (2021-10-30)
0.3.19 (2021-10-27)
- improve CSP support (#181)
0.3.18 (2021-10-26)
- ensure filesystem routing is skipped when there is a page route file (95eff57)
- improve overall precende algorithm (4f84f4e)
0.3.17 (2021-10-25)
- improve route string precedence (74e6abb)
0.3.16 (2021-10-25)
- refactor route precedence algorithm (8ce369b)
- Route Functions should return
precedence
instead ofmatchValue
, see https://vite-plugin-ssr.com/route-function
0.3.15 (2021-10-24)
- reduce priority of catch-all routes (3b11956)
0.3.14 (2021-10-24)
- make
outDir
configurable instead of always beeingdist/
(#177)
- Route String priority algorithm changed. AFAICT there aren't any breaking change, but no guarantee here.
0.3.13 (2021-10-21)
- link prefetching (9d93b46)
0.3.12 (2021-10-17)
- client router TS type (4d11ac3)
0.3.11 (2021-10-16)
- catch-all route is now
'/*'
instead of'/:params*'
, see https://vite-plugin-ssr.com/catch-all
0.3.10 (2021-10-09)
- prepare Vite breaking change (8312b5d)
0.3.9 (2021-10-08)
- add option
useClientRouter({ ensureHydration: boolean })
to mitigate "Hydration Mismatch" errors for Vue users" (c5891cd) - fix tolerate readable streams with missing read() handler (#138) (e33eea4)
- stop make superfluous
.pageContext.json
requests when there are noonBeforeRender()
defined on the server-side (#95) (6a16049) - tolerate readable streams with missing
read()
handler (#138) (a214190)
0.3.8 (2021-10-07)
- add option
useClientRouter({ ensureHydration: boolean })
to mitigate "Hydration Mismatch" errors for Vue users" (c5891cd) - stop make superfluous
.pageContext.json
requests when there are noonBeforeRender()
defined on the server-side (#95) (6a16049) - tolerate readable streams with missing
read()
handler (#138) (a214190)
0.3.7 (2021-10-05)
- also add
@brillout/json-s
tooptimizeDeps
(ed255d1)
0.3.6 (2021-10-05)
0.3.5 (2021-10-05)
- circumvent Vite bug that occurs when HTML has no
<head>
(e282837) - tell Vite what to pre-bundle (fix #156) (59dfb4c)
0.3.4 (2021-10-05)
- make sure
renderPage()
never throws an error, gracefully handle errors instead (ec37859)
0.3.3 (2021-09-29)
- HTML streaming support (#138)
0.3.2 (2021-09-22)
- correctly handle base URL that contains a URL origin (fix #149) (41fb77c)
- filesystem routing: also map
src/
directories to empty string (c629cbe)
pageContext.httpResponse.bodyWebStream
,pageContext.httpResponse.bodyNodeStream
,pageContext.httpResponse.getBody()
(c2e1ce2)
0.3.1 (2021-09-14)
- unkown exports warning (324480c)
0.3.0 (2021-09-14)
- dx: forbid user to inject assets twice instead of silently failing (6d4166e)
- support latest
@types/node
version (3078ac5) - ts: use all strict flags in order to accommodate for users with strict TS settings (#145) (fd5bae5)
- implement domain-drive file structure (closes #125) (fb368ff)
- allow
render()
hook to modifypageContext
(e.g. boilerplate-react/renderer/_default.page.server.jsx) onBeforeRoute()
out of betaonBeforePrerender()
out of betavite-plugin-ssr
can now automatically inject assets to HTML in more situations (paving the way for built-in HTML streaming support)
-
dangerouslySkipEscape
is now a standalone import.// _default.page.server.js - import { html } from "vite-plugin-ssr" + import { html, dangerouslySkipEscape } from "vite-plugin-ssr" export function render() { return html`<!DOCTYPE html> <html> <body> - <div id="page-view">${html.dangerouslySkipEscape(pageHtml)}</div> + <div id="page-view">${dangerouslySkipEscape(pageHtml)}</div> </body> </html>` }
-
html
template tag renamed toescapeInject
.// _default.page.server.js - import { html, dangerouslySkipEscape } from "vite-plugin-ssr" + import { escapeInject, dangerouslySkipEscape } from "vite-plugin-ssr" export function render() { - return html`<!DOCTYPE html> + return escapeInject`<!DOCTYPE html> <html> <body> <div id="page-view">${dangerouslySkipEscape(pageHtml)}</div> </body> </html>` }
-
createPageRender()
renamedcreatePageRenderer()
.// server.js - const renderPage = createPageRender(/*...*/) + const renderPage = createPageRenderer(/*...*/)
-
renderPage()
changes:// server.js const renderPage = createPageRenderer(/*...*/) app.get('*', async (req, res, next) => { const url = req.originalUrl - const pageContext = { url } - const result = await renderPage(pageContext) - if (result.nothingRendered) return next() - res.status(result.statusCode).send(result.renderResult) + const pageContextInit = { url } + const pageContext = await renderPage(pageContextInit) + if (!pageContext.httpResponse) return next() + res.status(pageContext.httpResponse.statusCode).send(pageContext.httpResponse.body) })
-
Hook
addPageContext()
deprecated and replaced withonBeforeRender()
.// *.page.server.js - export function addPageContext(pageContext) { + export function onBeforeRender(pageContext) { const pageProps = /*...*/ - return { pageProps } + return { + pageContext: { + pageProps + } + } }
-
_onBeforeRoute()
and_onBeforePrerender()
are out of beta: rename them toonBeforeRoute()
andonBeforePrerender()
. -
_injectAssets()
is now a standalone import.// _default.page.server.js - import { html } from "vite-plugin-ssr" + import { _injectAssets } from "vite-plugin-ssr" export function render() { - html._injectAssets(/*...*/) + _injectAssets(/*...*/) }
0.2.13 (2021-09-03)
- ts: fix typings for HTML Fragments (392268a)
0.2.12 (2021-09-01)
- do not override page's
render
hook (0f51330)
- [beta feature] allow user to define
_onBeforeRoute()
hook (#136, fix #140) (91ed460) - allow
_onBeforeRoute()
to modifypageContext.url
(bad2405) - allow missing
.page.js
when.page.client.js
and.page.server.js
is defined (37f6f6b) - [beta feature] allow user to define
_onBeforePrerender()
hook (fix #136) (9b6a135) - dx: improve no route matching warning (586e1c4)
0.2.11 (2021-08-22)
- allow
parallel
option to be passed via cli (9a94bc9)
0.2.10 (2021-08-22)
- pre-rendering: allow user to control concurrency (fix #134, fix (c7f9454)
- ts: fix conflicting ViteDevServer type definitions (8d3aef3)
- ts: make
getPage()
generic, e.g.getPage<SomeCustomPageContext>()
(f56104d)
0.2.9 (2021-08-15)
- allow pageContext to be Vue reactive (65ac828)
- dx: improve pageContext not available in browser wrong usage message (0563c20)
- help TS resolve plugin until TS supports
package.json#exports
(414ce14) - skip symbols and
toJSON
in pageContext proxy (361bca2) - ts: return plugin as
any
to avoid Plugin type mismatches when there are multiple Vite versions installed (34e9b6a)
0.2.8 (2021-08-12)
- dx: improve error message when user forgot to run
$ vite build
for production.
0.2.7 (2021-08-10)
- make server-side test work again for CF (fix #130) (fe01932)
- properly remove built-in props from error message (6e23c10)
- resolve --root arg (6a51f2a)
0.2.6 (2021-08-09)
0.2.5 (2021-08-06)
0.2.4 (2021-08-03)
- don't overwrite but supplement rollupOptions.input (f3268a8)
- impl
.page.server.js#doNotPrerender
to enable pre-rendering skipping (bfb2dd1)
0.2.3 (2021-07-21)
0.2.2 (2021-07-20)
0.2.1 (2021-07-19)
0.2.0 (2021-07-16)
- improve
dist/server/importBuild.js
ergonomics (cad8683)
dist/server/importer.js
has been renamed todist/server/importBuild.js
.
0.1.5 (2021-07-11)
- error when route string is missing a leading slash instead of silently failing (21052c6)
- properly handle URL suffix
.pageContext.json
for URL/
(84b3e76)
0.1.4 (2021-07-07)
- add option
$ vite-plugin-ssr prerender --noExtraDir
(c88e030) - provide TypeScript types for
pageContext
(fix #110) (ceb6ebd)
0.1.3 (2021-07-07)
- don't lower case when matching URLs (333583f)
- improve strategy to hunt down Vite cache bug (#108) (085207a)
0.1.2 (2021-06-17)
- also expose
pageContext.pageExports
on the client-side (83801ff) - support async route functions (fix #97) (0aca411)
0.1.1 (2021-06-09)
0.1.0 (2021-06-06)
Nothing changed (0.1.0
is equivalent to 0.1.0-beta.50
); vite-plugin-ssr
is now out of beta :-).
0.1.0-beta.50 (2021-06-02)
0.1.0-beta.49 (2021-06-02)
- dual publish CJS + ESM (vitejs/vite#3617, fix #85)
0.1.0-beta.48 (2021-05-30)
- export SsrEnv as type (8c8f5ba)
- Replace
dangerouslySetHtml
withdangerouslySkipEscape
. E.g. for linux users:git ls-files | xargs sed -i "s/dangerouslySetHtml/dangerouslySkipEscape/g"
0.1.0-beta.47 (2021-05-29)
- make
*.page.js
exports available to user aspageContext.pageExports
(fix #80)
0.1.0-beta.46 (2021-05-28)
- Apply following changes:
// *.page.server.js
export { render }
- function render({ Page, pageContext }) {
+ function render(pageContext) {
+ const { Page } = pageContext
/* ... */
}
export { addPageContext }
- function addPageContext({ Page, pageContext }) {
+ function addPageContext(pageContext) {
+ const { Page } = pageContext
/* ... */
}
// *.page.client.js
import { getPage } from "vite-plugin-ssr/client";
- const { Page, pageContext } = await getPage();
+ const pageContext = await getPage();
+ const { Page } = pageContext
// *.page.client.js
import { useClientRouter } from 'vite-plugin-ssr/client/router'
useClientRouter({
- render({ Page, pageContext, isHydration }) {
+ render(pageContext) {
+ const { Page, isHydration } = pageContext
/* ... */
},
})
// At your server integration point
const express = require('express')
const { createPageRender } = require('vite-plugin-ssr')
/* ... */
const pageRender = createPageRender(/*...*/)
/* ... */
- pageRender({ url, pageContext })
+ pageContext.url = url
+ pageRender(pageContext)
pageContext.urlFull
is deprecated; usepageContext.urlNormalized
instead.
0.1.0-beta.45 (2021-05-26)
- reload glob imports in dev (#66) (09b54c0)
- Route Functions should return
routeParams
instead ofcontextProps
(fix #63) (e03b918)
- always route on the server-side (fix #73) (ef3eb3c)
- rename
contextProps
topageContext
, andaddContextProps
toaddPageContext
(fix #58) (aedf9fc), closes #58
- Replace all occurences in your source code of
addContextProps
toaddPageContext
, and all occurences ofcontextProps
topageContext
. There is no need for semantic replacing: you can simply replace text, for example with a linux terminal:git ls-files | xargs sed -i "s/addContextProps/addPageContext/g"
git ls-files | xargs sed -i "s/contextProps/pageContext/g"
- Make your Route Functions return
{ match: true, routeParams: {/*...*/} }
instead of{ match: true, pageContext: {/*...*/} }
(or{ match: true, contextProps: {/*...*/} }
if you didn't renamecontextProps
topageContext
yet).
0.1.0-beta.44 (2021-05-20)
- Add mime types to preload tags, add common image preload tags (29a3b96)
0.1.0-beta.43 (2021-05-18)
- use
visibilitychange
event instead ofunload
event (b2cc36e)
- implement
<a keep-scroll-position />
andnavigate(url, { keepScrollPosition: true })
(#62) (6a8515a)
0.1.0-beta.42 (2021-05-14)
0.1.0-beta.41 (2021-05-14)
0.1.0-beta.40 (2021-05-05)
- add empty .npmignore to ensure dist/ is always published (c241c53)
0.1.0-beta.38 (2021-05-05)
0.1.0-beta.37 (2021-05-04)
- make route parameters available only at
contextProps.routeParams
(f98f94b)
- Route parameters are not available directly at
contextProps
anymore. E.g. usecontextProps.routeParams.movieId
instead ofcontextProps.movieId
(for a route string/movie/:movieId
).
0.1.0-beta.36 (2021-05-01)
- also check windows path for
usesClientRouter
test (b3c1cab) - do not assume .page.js files to always be the root in the manifest (fix #51) (138a3f7)
- fix preload tags paths when building on windows (9c2fd40)
0.1.0-beta.35 (2021-04-26)
vite-fix-2390
is not required anymore (& bump Vite dependency) (36fade0)- do not reload page when user only changes the URL hash (dbb6f9a)
- do not use new URL for extracting URL search and URL hash (fix #47) (4f3d737)
- throttle
scroll
event listener (fix #46) (c58d1ff) - use browser scroll restore for first page load (b6f701b)
- allow Route Functions to return a boolean and make returning
match
optional (963e488) - make
contextProps.urlParsed
available to user (97aa908)
0.1.0-beta.34 (2021-04-21)
- simplify
navigationState
and avoid unnecessarycontextProps
fetching when navigating to/#
(#43) (9e2196b) - use path.posix.relative instead of path.relative (5eadbb1)
- version number in assertion messages (47a99a6)
- make
contextProps.urlFull
andcontextProps.urlPathname
available everywhere (fix #42, fix #42) (b3f46fc)
contextProps.url
andcontextProps.urlNormalized
are deprecated: usecontextProps.urlFull
andcontextProps.urlPathname
instead.
0.1.0-beta.33 (2021-04-17)
- retrieve context props for 404 page, and expect missing context props for 404 page if no
_error.page.js
is defined (fix #41) (55cd596)
0.1.0-beta.32 (2021-04-16)
- simplify data fetching (2d1a52d)
pageProps
andsetPageProps()
are deprecated. Define your page props oncontextProps.pageProps
by returningpageProps
inaddContextProps()
, and thenexport const passToClient = ['pageProps']
in.page.server.js
to tellvite-plugin-ssr
to serialize and passcontextProps.pageProps
to the browser. In the browsercontextProps
is now available atconst { Page, contextProps } = await getPage()
anduseClientRouter({ render({ Page, contextProps, isHydration }) })
.
0.1.0-beta.31 (2021-04-15)
- remove test files from boilerplates (c255dbb)
- use
parseUrl()
instead ofnew URL()
(fix #28) (447d095)
0.1.0-beta.30 (2021-04-10)
- prevent dynamic dependency paths from mistakenly being statically analysed (a1eca47)
- accept any valid URL to be passed to
renderPage()
(930865e) - add
contextProps.routeParams
(512a253) - add
contextProps.urlNormalized
(9c932b0)
0.1.0-beta.29 (2021-04-10)
- ssr vite entry path (0237d78)
0.1.0-beta.28 (2021-04-10)
- cli: process exit 1 on unhandled promise rejections (fix #33) (6ab3b49)
- [cloudflare workers] do not import plugin code in prod (#1) (a6af9e7)
- change url right before rendering new page (97530f0)
- do not assume asset path to start with
assets/
(fix #32) (9791c41) - improve error handling for CF workers (70a89e0)
- [cloudflare workers] generate importer.js (#1) (dfa4e76)
- cli: add option to set
root
(4f1087a) - [cloudflare workers] allow user to manually set Vite Manifests (#1) (75aa55e)
- [cloudflare workers] make loading vite entry user file loader self sufficient for build (#1) (0693184)
- [cloudflare workers] remove client-side code in SSR bundles (#1) (557fabc)
import ssr from 'vite-plugin-ssr'
now throws an error; useimport ssr from 'vite-plugin-ssr/plugin'
instead.
0.1.0-beta.27 (2021-04-03)
- auto-detect whether
useClientRouter()
is used and pass that info to the pre-render + pass Vite'sbase
value to the pre-render (698f060) - support base url for prod server (de8c0e0)
0.1.0-beta.26 (2021-03-30)
- CJS default plugin export (09c3ee4)
0.1.0-beta.25 (2021-03-30)
- TS type declarations (40de96a)
0.1.0-beta.24 (2021-03-30)
- use vite@2.1.4 (1ff3668)
- This release only works with
@vite@2.1.4
; make sure to pin yourvite
dependency to2.1.4
in yourpackage.json
.
0.1.0-beta.23 (2021-03-28)
- add CJS default export for
vite-plugin-ssr/plugin
(40216d2)
0.1.0-beta.22 (2021-03-28)
- only intercept regular left clicks on regular links (405a27f)
- save & restore scroll position upon client-side routing (72815c7)
- don't load plugin code in production (95e7e0f)
- It's now recommended to do
import ssr from 'vite-plugin-ssr/plugin';
instead ofimport ssr from 'vite-plugin-ssr';
. A warning will be shown otherwise.
0.1.0-beta.21 (2021-03-26)
- Filesystem Routing bug when common prefix ends in filename (06ccfaa)
- fix mapping of pageId and page files (fix #18) (45436f5)
- use some-path/index.html instead of some-path.html (fix #19) (7281ffe)
- expose CLI as JavaScript API (e16ec91)
0.1.0-beta.20 (2021-03-26)
- update peer dependency on vite 2.1.2->2.1.3 (6778f09)
- this release works only with vite@2.1.3 so make sure to pin your vite dependency to 2.1.3
0.1.0-beta.19 (2021-03-25)
0.1.0-beta.18 (2021-03-24)
- when injecting HTML: also recognize tags that have attributes (651428a)
- impl
useClientRouter()
(4cfe4ef)
0.1.0-beta.17 (2021-03-19)
- remove zero-js problematic example (69d662d)
- impl pre-rendering (2e9de2d)
0.1.0-beta.16 (2021-03-18)
0.1.0-beta.15 (2021-03-17)
0.1.0-beta.14 (2021-03-17)
- improve thenable check (62fca8e)
- remove need for AntiFlicker by preloading styles in dev (debb9bd), closes #2
- Revert "failed attempt 4 for a workaround for vitejs/vite#2390" (4c2130f), closes vitejs/vite#2390
0.1.0-beta.13 (2021-03-14)
- do not assertUsage viteDevServer in production (d7f69c5)
0.1.0-beta.12 (2021-03-12)
0.1.0-beta.11 (2021-03-09)
- skip /favicon.ico requests (f528784)
- rename
createRender()
tocreatePageRender()
(f62dc8e)
- improve error handling (4a945bf)
- improve route functions (9af7f7b)
- improve usage error messages (cc0d678)
- server integration point
createRender()
renamed tocreatePageRender()
. render()
function (const render = createRender(/*...*/)
) now returns an object{ nothingRendered, renderResult, statusCode }
._404.page.js
and_500.page.js
deprecated and replaced with_error.page.js
.
0.1.0-beta.10 (2021-03-05)
- convert windows path to posix for micromatch (cc9c405), closes #4
- don't try to inject dynamic import polyfill (fdffd37)
- boilerplates: remove duplicated file (4421aa6)
- allow render hook to return an object instead of HTML (a649eaf)
- support _500.page.js and improve error handling (d492b9c)
- support
html
tag composition (9a57006)
0.1.0-beta.9 (2021-03-01)
- Fix released build
0.1.0-beta.8 (2021-03-01)
- remove html.sanitize and make sanitized automatic (95d145c)
- Removed
html.sanitize()
; simply directly insert the string and vite-plugin-ssr will automatically sanitize it
0.1.0-beta.7 (2021-02-28)
- Pass
Page
to addContextProps. (2512ee3)
0.1.0-beta.6 (2021-02-22)
Initial public release