Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vikejs/vike
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.4.140
Choose a base ref
...
head repository: vikejs/vike
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.141
Choose a head ref

Commits on Aug 30, 2023

  1. docs: minor

    brillout committed Aug 30, 2023
    Copy the full SHA
    9386e8a View commit details
  2. examples: Remove unused imports

    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    bf45e6c View commit details
  3. examples: fix dependency conflict

        npm ERR! Found: vite@4.4.9
        npm ERR! node_modules/vite
        npm ERR!   vite@"^4.4.8" from the root project
        npm ERR!
        npm ERR! Could not resolve dependency:
        npm ERR! peer vite@"^2.0.0" from vite-plugin-md@0.11.9
        npm ERR! node_modules/vite-plugin-md
        npm ERR!   vite-plugin-md@"^0.11.8" from the root project
    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    64d040c View commit details
  4. chore: Regenerate pnpm-lock.yaml

    to make the CI happy.
    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    c666d3a View commit details
  5. Revert pnpm-lock.yaml and update vite-plugin-md

    with `pnpm up vite-plugin-md --latest`
    
    This partly reverts commit 36a560a.
    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    48379aa View commit details
  6. Copy the full SHA
    1b58164 View commit details
  7. qual: add comment to GitHub Action

    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    aed9574 View commit details
  8. chore: switch from vite-plugin-md to unplugin-vue-markdown

    vite-plugin-md@0.13 introduced a major change, and the old way has been forked
    to unplugin-vue-markdown. See https://github.com/antfu/vite-plugin-md
    
    lang="ts" had to be removed in order to avoid
    Error: [@vue/compiler-sfc] <script> and <script setup> must have the same language type.
    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    d4bc9ee View commit details
  9. qual: fix 'pnpm run test:types'

    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    bab0274 View commit details
  10. docs: Fix link

    lourot authored and brillout committed Aug 30, 2023
    Copy the full SHA
    8974ba1 View commit details
  11. chore: update comment

    brillout committed Aug 30, 2023
    Copy the full SHA
    b0d0b10 View commit details
  12. Copy the full SHA
    8dce11f View commit details

Commits on Aug 31, 2023

  1. Copy the full SHA
    27e44fd View commit details
  2. release new boilerplates

    brillout committed Aug 31, 2023
    Copy the full SHA
    c9d7c89 View commit details
  3. chore

    brillout committed Aug 31, 2023
    Copy the full SHA
    cb5a22a View commit details
  4. update TS

    brillout committed Aug 31, 2023
    Copy the full SHA
    87b2f48 View commit details
  5. Copy the full SHA
    c124c6b View commit details

Commits on Sep 1, 2023

  1. minor refactor

    brillout committed Sep 1, 2023
    Copy the full SHA
    99f5ba9 View commit details
  2. Copy the full SHA
    7343a85 View commit details
  3. docs: minor

    brillout committed Sep 1, 2023
    Copy the full SHA
    8a9c664 View commit details
  4. Copy the full SHA
    250158a View commit details
  5. minor refactor

    brillout committed Sep 1, 2023
    Copy the full SHA
    10e4d79 View commit details
  6. chore

    brillout committed Sep 1, 2023
    Copy the full SHA
    60d9f4a View commit details
  7. Copy the full SHA
    80a15a1 View commit details
  8. minor refactor

    brillout committed Sep 1, 2023
    Copy the full SHA
    0f106d4 View commit details
  9. Copy the full SHA
    fa02b0e View commit details
  10. Copy the full SHA
    83f8586 View commit details
  11. minor refactor

    brillout committed Sep 1, 2023
    Copy the full SHA
    fe47e55 View commit details
  12. Copy the full SHA
    64f684f View commit details

Commits on Sep 3, 2023

  1. Copy the full SHA
    a564bbd View commit details
  2. Copy the full SHA
    1bedc8a View commit details
  3. Copy the full SHA
    1dad1bb View commit details
  4. make configValues an array

    brillout committed Sep 3, 2023
    Copy the full SHA
    6353d76 View commit details
  5. make new configValues work

    brillout committed Sep 3, 2023
    Copy the full SHA
    2a20f64 View commit details
  6. minor refactor

    brillout committed Sep 3, 2023
    Copy the full SHA
    e55b6d6 View commit details
  7. fix regression

    brillout committed Sep 3, 2023
    Copy the full SHA
    680859d View commit details
  8. Copy the full SHA
    120e355 View commit details
  9. Copy the full SHA
    88830b9 View commit details
  10. minor refactor

    brillout committed Sep 3, 2023
    Copy the full SHA
    7744338 View commit details
  11. Copy the full SHA
    e01aba8 View commit details
  12. comment

    brillout committed Sep 3, 2023
    Copy the full SHA
    e11f32f View commit details
  13. make tmp copy correct

    brillout committed Sep 3, 2023
    Copy the full SHA
    f2babc1 View commit details
  14. fix temp migration

    brillout committed Sep 3, 2023
    Copy the full SHA
    2a7586a View commit details
  15. Copy the full SHA
    eafb92d View commit details
  16. minor refactor

    brillout committed Sep 3, 2023
    Copy the full SHA
    c3efe7b View commit details
  17. minor

    brillout committed Sep 3, 2023
    Copy the full SHA
    0b0beb3 View commit details
  18. improve data structure

    brillout committed Sep 3, 2023
    Copy the full SHA
    72bce5b View commit details
  19. Copy the full SHA
    65fd302 View commit details
  20. Copy the full SHA
    1bb7435 View commit details
  21. Copy the full SHA
    b7a431f View commit details
Showing with 2,754 additions and 1,518 deletions.
  1. +1 −1 .github/workflows/ci.yml
  2. +2 −2 .github/workflows/ci/getTestJobs.mjs
  3. +41 −0 CHANGELOG.md
  4. +1 −1 boilerplates/boilerplate-react-ts/package.json
  5. +9 −0 boilerplates/boilerplate-react-ts/server/tsconfig.json
  6. +3 −1 boilerplates/boilerplate-react-ts/tsconfig.json
  7. +1 −1 boilerplates/boilerplate-react/package.json
  8. +1 −1 boilerplates/boilerplate-vue-ts/package.json
  9. +9 −0 boilerplates/boilerplate-vue-ts/server/tsconfig.json
  10. +3 −1 boilerplates/boilerplate-vue-ts/tsconfig.json
  11. +1 −1 boilerplates/boilerplate-vue/package.json
  12. +1 −1 boilerplates/package.json
  13. +14 −6 docs/components/static-host.tsx
  14. +1 −1 docs/package.json
  15. +1 −1 docs/pages/markdown.page.server.mdx
  16. +2 −2 docs/pages/pre-rendering.page.server.mdx
  17. +1 −1 docs/pages/redirect.page.server.mdx
  18. +5 −1 docs/pages/redirects.page.server.mdx
  19. +5 −2 docs/pages/route-function.page.server.mdx
  20. +1 −1 docs/pages/url-normalization.page.server.mdx
  21. +1 −1 docs/utils/projectInfo.tsx
  22. 0 examples/auth/components/{Counter.jsx → Counter.tsx}
  23. +1 −1 examples/auth/package.json
  24. +1 −6 examples/auth/pages/+config.h.ts
  25. +1 −1 examples/base-url-cdn-v1/package.json
  26. +1 −1 examples/base-url-cdn/package.json
  27. +1 −1 examples/base-url-server-v1/package.json
  28. +1 −1 examples/base-url-server/package.json
  29. +1 −1 examples/base-url-v1/package.json
  30. +1 −1 examples/base-url/package.json
  31. +1 −1 examples/cloudflare-workers-react-full-v1/package.json
  32. +1 −1 examples/cloudflare-workers-react-full/package.json
  33. +1 −1 examples/cloudflare-workers-react-v1/package.json
  34. +1 −1 examples/cloudflare-workers-react/package.json
  35. +1 −1 examples/cloudflare-workers-vue-v1/package.json
  36. +1 −1 examples/cloudflare-workers-vue/package.json
  37. +1 −1 examples/custom-preload-v1/package.json
  38. +1 −1 examples/file-structure-domain-driven-v1/package.json
  39. +1 −1 examples/file-structure-domain-driven/package.json
  40. +1 −1 examples/graphql-apollo-react-v1/package.json
  41. +1 −1 examples/graphql-apollo-react/package.json
  42. +1 −1 examples/graphql-apollo-vue-v1/package.json
  43. +1 −1 examples/graphql-apollo-vue/package.json
  44. +14 −1 examples/html-fragments-v1/.testRun.ts
  45. +1 −1 examples/html-fragments-v1/package.json
  46. +2 −11 examples/html-fragments/.test.ts
  47. +1 −1 examples/html-fragments/package.json
  48. +1 −1 examples/i18n-v1/package.json
  49. +1 −1 examples/i18n/package.json
  50. +1 −1 examples/layouts-react-v1/package.json
  51. +1 −1 examples/layouts-react/package.json
  52. +1 −1 examples/layouts-vue-v1/package.json
  53. +1 −1 examples/layouts-vue/package.json
  54. +1 −1 examples/path-aliases-v1/package.json
  55. +1 −1 examples/path-aliases/package.json
  56. +1 −1 examples/preact-client-routing-v1/package.json
  57. +1 −1 examples/preact-client-routing/package.json
  58. +1 −1 examples/preact-server-routing-v1/package.json
  59. +1 −1 examples/preact-server-routing/package.json
  60. +1 −1 examples/react-17-v1/package.json
  61. +1 −1 examples/react-17/package.json
  62. +1 −1 examples/react-full-v1/package.json
  63. +1 −1 examples/react-full/package.json
  64. +1 −1 examples/react-router-v1/package.json
  65. +1 −1 examples/react-router/package.json
  66. +1 −1 examples/react-streaming-v1/package.json
  67. +1 −1 examples/react-streaming/package.json
  68. +1 −1 examples/react-v1/package.json
  69. +1 −1 examples/react/package.json
  70. +1 −1 examples/redux-v1/package.json
  71. +4 −0 examples/redux-v1/renderer/+config.h.js
  72. +0 −2 examples/redux-v1/renderer/+passToClient.js
  73. +1 −1 examples/redux/package.json
  74. +1 −1 examples/render-modes-v1/package.json
  75. +1 −1 examples/render-modes/package.json
  76. +1 −1 examples/solid-spa-v1/package.json
  77. +1 −1 examples/solid-spa/package.json
  78. +1 −1 examples/solid-ssr-v1/package.json
  79. +1 −1 examples/solid-ssr/package.json
  80. +1 −1 examples/stem-react/package.json
  81. +1 −1 examples/svelte-v1/package.json
  82. +1 −1 examples/telefunc-v1/package.json
  83. +1 −1 examples/telefunc/package.json
  84. +1 −1 examples/urql-v1/package.json
  85. +1 −1 examples/urql/package.json
  86. +1 −1 examples/vanilla-v1/package.json
  87. +1 −1 examples/vike-react-simple/package.json
  88. +1 −1 examples/vike-react/package.json
  89. +2 −2 examples/vue-full-v1/package.json
  90. +0 −1 examples/vue-full-v1/pages/_error/+Page.vue
  91. +1 −1 examples/vue-full-v1/pages/markdown/+Page.md
  92. +1 −1 examples/vue-full-v1/readme.md
  93. +2 −2 examples/vue-full-v1/vite.config.ts
  94. +2 −2 examples/vue-full/package.json
  95. +1 −1 examples/vue-full/pages/markdown.page.md
  96. +2 −2 examples/vue-full/vite.config.ts
  97. +1 −1 examples/vue-pinia-v1/package.json
  98. +1 −1 examples/vue-pinia/package.json
  99. +1 −1 examples/vue-router-v1/package.json
  100. +1 −1 examples/vue-router/package.json
  101. +1 −1 examples/vue-v1/package.json
  102. +1 −1 examples/vue/package.json
  103. +1 −1 examples/vuex-v1/package.json
  104. +1 −1 examples/vuex/package.json
  105. +1 −1 examples/webpack-v1/package.json
  106. +2 −2 package.json
  107. +129 −71 pnpm-lock.yaml
  108. +8 −23 test-e2e.config.mjs
  109. +1 −1 test/abort-v1/package.json
  110. +7 −0 test/abort-v1/pages/redirect-external/+Page.tsx
  111. +7 −0 test/abort-v1/pages/redirect-external/+guard.ts
  112. +2 −0 test/abort-v1/renderer/PageLayout.tsx
  113. +32 −1 test/abort-v1/test.ts
  114. +2 −1 test/abort-v1/vite.config.ts
  115. +1 −1 test/build.outDir-v1/package.json
  116. +1 −1 test/build.outDir/package.json
  117. +1 −1 test/cjs/package.json
  118. +1 −1 test/config-file-paths-v1/package.json
  119. +1 −1 test/config-side-export/package.json
  120. +1 −1 test/contra-v1/package.json
  121. +1 −1 test/contra/package.json
  122. +1 −1 test/disableAutoImporter-v1/package.json
  123. +1 −1 test/disableAutoImporter/package.json
  124. +1 −1 test/env/package.json
  125. +1 −1 test/hook-override/package.json
  126. +8 −0 test/hook-override/pages/+config.h.ts
  127. +0 −6 test/hook-override/pages/+passToClient.ts
  128. +1 −1 test/hook-override/test.ts
  129. +1 −1 test/includeAssetsImportedByServer-v1/package.json
  130. +1 −1 test/includeAssetsImportedByServer/package.json
  131. +1 −1 test/pageFlesSrc/package.json
  132. +1 −1 test/preload-v1/package.json
  133. +1 −1 test/renderPage-v1/package.json
  134. +1 −1 test/renderPage/package.json
  135. +1 −1 test/require-shim-v1/package.json
  136. +1 −1 test/require-shim/package.json
  137. +1 −1 test/stream-v1/package.json
  138. +1 −1 test/stream/package.json
  139. +6 −13 vite-plugin-ssr/TODO
  140. +2 −1 vite-plugin-ssr/__internal/index.ts
  141. +1 −1 vite-plugin-ssr/client/client-routing-runtime/createPageContext.ts
  142. +5 −5 vite-plugin-ssr/client/client-routing-runtime/getPageContext.ts
  143. +2 −2 vite-plugin-ssr/client/client-routing-runtime/getPageContext/removeBuiltInOverrides.ts
  144. +7 −19 vite-plugin-ssr/client/client-routing-runtime/navigate.ts
  145. +2 −0 vite-plugin-ssr/client/client-routing-runtime/prefetch/getPrefetchSettings.ts
  146. +26 −10 vite-plugin-ssr/client/client-routing-runtime/useClientRouter.ts
  147. +2 −2 vite-plugin-ssr/client/server-routing-runtime/getPageContext.ts
  148. +1 −2 vite-plugin-ssr/node/cli/bin.ts
  149. +5 −2 vite-plugin-ssr/node/plugin/index.ts
  150. +8 −3 vite-plugin-ssr/node/plugin/plugins/autoFullBuild.ts
  151. +15 −14 vite-plugin-ssr/node/plugin/plugins/buildConfig.ts
  152. +3 −1 vite-plugin-ssr/node/plugin/plugins/commonConfig.ts
  153. +2 −1 vite-plugin-ssr/node/plugin/plugins/config/index.ts
  154. +12 −3 vite-plugin-ssr/node/plugin/plugins/config/resolveBase.ts
  155. +7 −4 vite-plugin-ssr/node/plugin/plugins/config/resolveExtensions.ts
  156. +17 −12 vite-plugin-ssr/node/plugin/plugins/devConfig/determineOptimizeDeps.ts
  157. +6 −8 vite-plugin-ssr/node/plugin/plugins/extractAssetsPlugin.ts
  158. +1 −1 vite-plugin-ssr/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.ts
  159. +1 −1 vite-plugin-ssr/node/plugin/plugins/importUserCode/index.ts
  160. +393 −268 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.ts
  161. +99 −21 ...plugin-ssr/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.ts
  162. +30 −0 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.spec.ts
  163. +49 −20 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.ts
  164. +35 −19 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/getVirtualFileImportCodeFiles.ts
  165. +9 −3 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/getVirtualFileImportPageConfigs.ts
  166. +32 −0 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/helpers.ts
  167. +131 −52 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/serializePageConfigs.ts
  168. +1 −1 vite-plugin-ssr/node/plugin/plugins/importUserCode/v1-design/transpileAndExecuteFile.ts
  169. +4 −1 vite-plugin-ssr/node/plugin/plugins/previewConfig.ts
  170. +5 −1 vite-plugin-ssr/node/plugin/plugins/setGlobalContext.ts
  171. +4 −1 vite-plugin-ssr/node/plugin/shared/findPageFiles.ts
  172. +26 −0 vite-plugin-ssr/node/plugin/shared/getConfigValueSource.ts
  173. +5 −5 vite-plugin-ssr/node/plugin/shared/loggerNotProd.ts
  174. +1 −1 vite-plugin-ssr/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.ts
  175. +5 −5 vite-plugin-ssr/node/plugin/shared/loggerNotProd/log.ts
  176. +2 −0 vite-plugin-ssr/node/plugin/utils.ts
  177. +85 −49 vite-plugin-ssr/node/prerender/runPrerender.ts
  178. +6 −5 vite-plugin-ssr/node/runtime/globalContext.ts
  179. +2 −1 vite-plugin-ssr/node/runtime/html/injectAssets/getHtmlTags.ts
  180. +4 −1 vite-plugin-ssr/node/runtime/html/injectAssets/getViteDevScripts.ts
  181. +25 −14 vite-plugin-ssr/node/runtime/html/renderHtml.ts
  182. +2 −6 vite-plugin-ssr/node/runtime/html/serializePageContextClientSide.ts
  183. +23 −23 vite-plugin-ssr/node/runtime/html/stream.ts
  184. +1 −1 vite-plugin-ssr/node/runtime/index-deprecated.ts
  185. +1 −1 vite-plugin-ssr/node/runtime/index.ts
  186. +28 −17 vite-plugin-ssr/node/runtime/renderPage.ts
  187. +2 −2 vite-plugin-ssr/node/runtime/renderPage/analyzePage.ts
  188. +34 −24 vite-plugin-ssr/node/runtime/renderPage/assertArguments.ts
  189. +15 −6 vite-plugin-ssr/node/runtime/renderPage/createHttpResponseObject/assertNoInfiniteHttpRedirect.ts
  190. +18 −6 vite-plugin-ssr/node/runtime/renderPage/executeOnRenderHtmlHook.ts
  191. +9 −5 vite-plugin-ssr/node/runtime/renderPage/getHttpResponseBody.ts
  192. +2 −2 vite-plugin-ssr/node/runtime/renderPage/isNewError.ts
  193. +9 −9 vite-plugin-ssr/node/runtime/renderPage/log404/index.spec.snapshot-2
  194. +1 −1 vite-plugin-ssr/node/runtime/renderPage/log404/index.spec.ts
  195. +7 −4 vite-plugin-ssr/node/runtime/renderPage/log404/index.ts
  196. +2 −2 vite-plugin-ssr/node/runtime/renderPage/loggerProd.ts
  197. +6 −6 vite-plugin-ssr/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.ts
  198. +15 −5 vite-plugin-ssr/node/runtime/renderPage/renderPageAlreadyRouted.ts
  199. +1 −1 vite-plugin-ssr/node/runtime/utils.ts
  200. +17 −0 vite-plugin-ssr/node/shared/getClientEntryFilePath.ts
  201. +1 −0 vite-plugin-ssr/node/shared/utils.ts
  202. +4 −4 vite-plugin-ssr/package.json
  203. +39 −0 vite-plugin-ssr/shared/VikeNamespace.ts
  204. +11 −12 vite-plugin-ssr/shared/{UrlComputedProps.ts → addUrlComputedProps.ts}
  205. +2 −1 vite-plugin-ssr/shared/assertOnBeforeRenderHookReturn.ts
  206. +16 −7 vite-plugin-ssr/shared/assertPageContextProvidedByUser.ts
  207. +2 −2 vite-plugin-ssr/shared/getPageFiles/analyzeClientSide.ts
  208. +1 −32 vite-plugin-ssr/shared/getPageFiles/assertPageConfigs.ts
  209. +23 −19 vite-plugin-ssr/shared/getPageFiles/getExports.ts
  210. +27 −27 vite-plugin-ssr/shared/getPageFiles/parsePageConfigs.ts
  211. +21 −21 vite-plugin-ssr/shared/hooks/getHook.ts
  212. +59 −65 vite-plugin-ssr/shared/page-configs/Config.ts
  213. +27 −0 vite-plugin-ssr/shared/page-configs/Config/PageContextConfig.ts
  214. +32 −0 vite-plugin-ssr/shared/page-configs/Config/helpers.ts
  215. +78 −55 vite-plugin-ssr/shared/page-configs/PageConfig.ts
  216. +17 −0 vite-plugin-ssr/shared/page-configs/getExportPath.spec.ts
  217. +27 −0 vite-plugin-ssr/shared/page-configs/getExportPath.ts
  218. +67 −34 vite-plugin-ssr/shared/page-configs/loadPageCode.ts
  219. +96 −45 vite-plugin-ssr/shared/page-configs/utils.ts
  220. +16 −23 vite-plugin-ssr/shared/route/abort.ts
  221. +28 −8 vite-plugin-ssr/shared/route/executeOnBeforeRouteHook.ts
  222. +8 −3 vite-plugin-ssr/shared/route/index.ts
  223. +20 −16 vite-plugin-ssr/shared/route/loadPageRoutes.ts
  224. +70 −0 vite-plugin-ssr/shared/route/resolveRedirects.spec.ts
  225. +34 −28 vite-plugin-ssr/shared/route/resolveRedirects.ts
  226. +3 −2 vite-plugin-ssr/shared/route/resolveRoute.ts
  227. +19 −16 vite-plugin-ssr/shared/route/resolveRouteFunction.ts
  228. +2 −35 vite-plugin-ssr/shared/route/resolveRouteString.spec.ts
  229. +6 −6 vite-plugin-ssr/shared/route/resolveRouteString.ts
  230. +18 −11 vite-plugin-ssr/shared/types.ts
  231. +1 −0 vite-plugin-ssr/shared/utils.ts
  232. +1 −1 vite-plugin-ssr/tsconfig.json
  233. +34 −7 vite-plugin-ssr/types/index.ts
  234. +6 −3 vite-plugin-ssr/utils/assert.ts
  235. +23 −11 vite-plugin-ssr/utils/assertDefaultExport.ts
  236. +3 −2 vite-plugin-ssr/utils/assertRoutingType.ts
  237. +5 −8 vite-plugin-ssr/utils/assertSingleInstance.ts
  238. +1 −1 vite-plugin-ssr/utils/filesystemPathHandling.ts
  239. +3 −2 vite-plugin-ssr/utils/freezePartial.spec.ts
  240. +9 −3 vite-plugin-ssr/utils/freezePartial.ts
  241. +4 −1 vite-plugin-ssr/utils/getOutDirs.ts
  242. +8 −0 vite-plugin-ssr/utils/getPropAccessNotation.ts
  243. +15 −0 vite-plugin-ssr/utils/getValuePrintable.spec.ts
  244. +5 −0 vite-plugin-ssr/utils/getValuePrintable.ts
  245. +1 −0 vite-plugin-ssr/utils/isNpmPackage.spec.ts
  246. +31 −0 vite-plugin-ssr/utils/mergeCumulativeValues.spec.ts
  247. +21 −0 vite-plugin-ssr/utils/mergeCumulativeValues.ts
  248. +1 −1 vite-plugin-ssr/utils/pLimit.ts
  249. +32 −13 vite-plugin-ssr/utils/parseUrl-extras.spec.ts
  250. +15 −0 vite-plugin-ssr/utils/parseUrl-extras.ts
  251. +23 −20 vite-plugin-ssr/utils/parseUrl.ts
  252. +1 −1 vite-plugin-ssr/utils/projectInfo.ts
  253. +0 −4 vite-plugin-ssr/utils/stripAnsi.ts
  254. +1 −1 vite-plugin-ssr/utils/trackLogs.ts
  255. +2 −2 vite-plugin-ssr/utils/truncateString.ts
  256. +31 −0 vite-plugin-ssr/utils/warnIfErrorIsNotObject.ts
  257. +0 −16 vite-plugin-ssr/utils/warnIfObjectIsNotObject.ts
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ jobs:
cache: "pnpm"

- run: pnpm install
- run: pnpm exec playwright install chromium # Needed for Windows/MacOS
- run: pnpm exec playwright install chromium
- run: pnpm run build

- name: Run tests
4 changes: 2 additions & 2 deletions .github/workflows/ci/getTestJobs.mjs
Original file line number Diff line number Diff line change
@@ -38,13 +38,13 @@ async function getTestJobs() {
jobName: 'Unit Tests',
jobCmd: 'pnpm run test:units',
jobTestFiles: specFiles,
jobSetups: [{ os: 'ubuntu-latest', node_version: '20' }]
jobSetups: [{ os: 'ubuntu-latest', node_version: '18' }]
},
// Typecheck `.ts` files
{
jobName: 'TypeScript',
jobCmd: 'pnpm run test:types',
jobSetups: [{ os: 'ubuntu-latest', node_version: '20' }]
jobSetups: [{ os: 'ubuntu-latest', node_version: '18' }]
},
// E2e tests
...(await crawlE2eJobs(testFiles))
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
## [0.4.141](https://github.com/brillout/vite-plugin-ssr/compare/v0.4.140...v0.4.141) (2023-09-15)


### Bug Fixes

* `throw redirect(/some-url/, 301)` (fix [#1104](https://github.com/brillout/vite-plugin-ssr/issues/1104)) ([64f684f](https://github.com/brillout/vite-plugin-ssr/commit/64f684f8e8709b1e0fb8ae06570120b4291e72be))
* +config.h.js prerender flag ([2c58da8](https://github.com/brillout/vite-plugin-ssr/commit/2c58da83abbcd3b2d6720838040f39ceb996a451))
* add hint to error message upon invalid route string ([c1537dc](https://github.com/brillout/vite-plugin-ssr/commit/c1537dcf2bd7725ae9690606cd31ec9f51b7dc69))
* add missing config type to PageContextBuiltInServer ([362d69c](https://github.com/brillout/vite-plugin-ssr/commit/362d69c3cb98b165038de8262a04aab2203d29a1))
* avoid overriding meta ([f2ec4bd](https://github.com/brillout/vite-plugin-ssr/commit/f2ec4bd44d98dcf8a0604234da702f3019f36765))
* enable vike-* packages to seamlessly extend Config using interface merging ([894c039](https://github.com/brillout/vite-plugin-ssr/commit/894c03903265f0fc7ed4d09e8d4c126316b10198))
* external redirects (fix [#1103](https://github.com/brillout/vite-plugin-ssr/issues/1103)) ([7343a85](https://github.com/brillout/vite-plugin-ssr/commit/7343a85f11fc7115a41659c0aeb76a6eb1fc1b4b))
* further discourage loading multiple versions (fix [#1108](https://github.com/brillout/vite-plugin-ssr/issues/1108)) ([3a66e95](https://github.com/brillout/vite-plugin-ssr/commit/3a66e952396b739bbedb6f8f8d7bac1d64026e90))
* further use colors instead of backtick in error messages ([3cdb970](https://github.com/brillout/vite-plugin-ssr/commit/3cdb9707bd6ad0969dd004612efebaaf5fb3861e))
* further use colors instead of backtick in error messages ([6739302](https://github.com/brillout/vite-plugin-ssr/commit/6739302e8e71eb4fc1f5c6098caf6a75f785fbdb))
* further use colors instead of backtick in error messages ([0f23c0d](https://github.com/brillout/vite-plugin-ssr/commit/0f23c0d2ac9c22d46f2828e3bb0b0bc52d733e46))
* further use colors instead of backtick in error messages ([b178539](https://github.com/brillout/vite-plugin-ssr/commit/b1785391d5ecf2f85ec5f38143503012125db313))
* further use colors instead of backtick in error messages ([2296914](https://github.com/brillout/vite-plugin-ssr/commit/229691493d90e505a2cae9b74da2f03171f0bcb9))
* improve error message about non-default exports ([58f8b2f](https://github.com/brillout/vite-plugin-ssr/commit/58f8b2fb5fbcea2f3ee28cbc9b0c741440c8d225))
* improve error message upon code defined inside header files ([687c5b2](https://github.com/brillout/vite-plugin-ssr/commit/687c5b25b42a264d7730bbdec8a4b8bfb7106643))
* improve JSDoc of `throw redirect()` ([2ce54a2](https://github.com/brillout/vite-plugin-ssr/commit/2ce54a2d6834d133a271b4d787530d4260be537c))
* improve log colors ([b936aee](https://github.com/brillout/vite-plugin-ssr/commit/b936aee111a78ead7274f6929000e4897b906039))
* improve serialization error message ([1bedc8a](https://github.com/brillout/vite-plugin-ssr/commit/1bedc8a76f7388fb269c188f3d0ba782e744713c))
* improve wrong redirection usage error ([83f8586](https://github.com/brillout/vite-plugin-ssr/commit/83f8586f47f59eda03613fe5bd53a4eb2ab0dd44))
* intercept log for `throw redirect()` ([950ebd0](https://github.com/brillout/vite-plugin-ssr/commit/950ebd0212c7717be5135c28d0e253ca4aacb561))
* make inheritence check consider whole path segments (fix [#1109](https://github.com/brillout/vite-plugin-ssr/issues/1109)) ([5bd8c1e](https://github.com/brillout/vite-plugin-ssr/commit/5bd8c1e128cad87d04ba5d54af1eda788dc69f54))
* set Page type to unknown instead of any by default ([412a26a](https://github.com/brillout/vite-plugin-ssr/commit/412a26aed262b868ef250265173372525d706a07))
* set pageContext.is404 upon throw render(404) (fix [#1107](https://github.com/brillout/vite-plugin-ssr/issues/1107)) ([9dd96c3](https://github.com/brillout/vite-plugin-ssr/commit/9dd96c31104e34f2cd9dc9313ccce0906a81dff1))
* use colors instead of backtick in error messages ([a052d52](https://github.com/brillout/vite-plugin-ssr/commit/a052d52656fd084d2df5f44502ddfad892aec97b))
* use colors instead of quotes in error messages ([ceb7af8](https://github.com/brillout/vite-plugin-ssr/commit/ceb7af8ec059159e0eea90f2a60b084af8691591))


### Features

* [V1 design] cumulative ([25af958](https://github.com/brillout/vite-plugin-ssr/commit/25af9587611e0bdf8df993f7c8f027460c0206aa))
* new namespace `Vike` to enable users to refine type `Config` ([c0e909d](https://github.com/brillout/vite-plugin-ssr/commit/c0e909d4e4e58ff506f02889773f0e927d4ccfde))
* static external redirections ([#926](https://github.com/brillout/vite-plugin-ssr/issues/926)) ([fa02b0e](https://github.com/brillout/vite-plugin-ssr/commit/fa02b0e0d1b1fc38689888482a6da629374f9e1b))
* static glob redirections ([#926](https://github.com/brillout/vite-plugin-ssr/issues/926)) ([80a15a1](https://github.com/brillout/vite-plugin-ssr/commit/80a15a110f3140001486e776af55e07a1917e00b))



## [0.4.140](https://github.com/brillout/vite-plugin-ssr/compare/v0.4.139...v0.4.140) (2023-08-30)


2 changes: 1 addition & 1 deletion boilerplates/boilerplate-react-ts/package.json
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vite-plugin-ssr": "^0.4.140"
"vite-plugin-ssr": "^0.4.141"
},
"type": "module"
}
9 changes: 9 additions & 0 deletions boilerplates/boilerplate-react-ts/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
// Make IDEs complain about missing file extension .js in import paths.
// Alternatively, we could always set "module" to "Node16" and add the file extension .js to import paths everywhere.
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16"
}
}
4 changes: 3 additions & 1 deletion boilerplates/boilerplate-react-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
"strict": true,
"module": "ES2020",
"target": "ES2020",
"moduleResolution": "Node",
// Doesn't apply to server/, see ts-node config down below and server/tsconfig.json
"moduleResolution": "Bundler",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": ["vite/client"],
"jsx": "react-jsx",
@@ -14,6 +15,7 @@
"transpileOnly": true,
"esm": true,
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16"
}
}
2 changes: 1 addition & 1 deletion boilerplates/boilerplate-react/package.json
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
"react-dom": "^18.2.0",
"sirv": "^2.0.3",
"vite": "^4.4.9",
"vite-plugin-ssr": "^0.4.140"
"vite-plugin-ssr": "^0.4.141"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion boilerplates/boilerplate-vue-ts/package.json
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vite-plugin-ssr": "^0.4.140",
"vite-plugin-ssr": "^0.4.141",
"vue": "^3.3.4"
},
"type": "module"
9 changes: 9 additions & 0 deletions boilerplates/boilerplate-vue-ts/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
// Make IDEs complain about missing file extension .js in import paths.
// Alternatively, we could always set "module" to "Node16" and add the file extension .js to import paths everywhere.
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16"
}
}
4 changes: 3 additions & 1 deletion boilerplates/boilerplate-vue-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
"strict": true,
"module": "ES2020",
"target": "ES2020",
"moduleResolution": "Node",
// Doesn't apply to server/, see ts-node config down below and server/tsconfig.json
"moduleResolution": "Bundler",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": ["vite/client"],
"skipLibCheck": true,
@@ -13,6 +14,7 @@
"transpileOnly": true,
"esm": true,
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16"
}
}
2 changes: 1 addition & 1 deletion boilerplates/boilerplate-vue/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
"express": "^4.18.2",
"sirv": "^2.0.3",
"vite": "^4.4.9",
"vite-plugin-ssr": "^0.4.140",
"vite-plugin-ssr": "^0.4.141",
"vue": "^3.3.4"
},
"type": "module"
2 changes: 1 addition & 1 deletion boilerplates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-vite-plugin-ssr",
"version": "0.0.301",
"version": "0.0.303",
"license": "MIT",
"bin": {
"create-vite-plugin-ssr": "index.js"
20 changes: 14 additions & 6 deletions docs/components/static-host.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ export { StaticHostDocIntro }
export { StaticHostDocStrategies }
export { StaticHostDocOutro }

import { Link } from '@brillout/docpress'
import React from 'react'

function StaticHostDocIntro({ staticHostLink }: { staticHostLink?: JSX.Element }) {
@@ -10,6 +11,14 @@ function StaticHostDocIntro({ staticHostLink }: { staticHostLink?: JSX.Element }
By <a href="/pre-rendering">pre-rendering</a> your pages, you can remove the need for a production server. You can
then deploy your app to any static host
{staticHostLink}.
<blockquote>
<p>
Static hosts always expect one <code>.html</code> file per URL. This means you need to pre-render <em>all</em>{' '}
your pages, regardless of <Link text="render mode" href="/render-modes" />. For example, if you have SPA
pages, then you also need to pre-render them which will generate <code>.html</code> files with an empty{' '}
<code>&lt;body&gt;</code>.
</p>
</blockquote>
</p>
)
}
@@ -27,6 +36,11 @@ function StaticHostDocStrategies({ name = 'the static host' }: { name?: string }
</li>
<li>Let {name} build your app.</li>
</ul>
<blockquote>
<p>
The <code>$ vite build</code> command generates <code>dist/client/</code> containing all static assets.
</p>
</blockquote>
</>
)
}
@@ -45,12 +59,6 @@ function StaticHostDocOutro({ baseUrlAddendum }: { baseUrlAddendum?: JSX.Element
</a>
.
</p>
<blockquote>
<p>
The <code>$ vite build</code> command generates a directory <code>dist/client/</code> that contains all static
assets.
</p>
</blockquote>
<blockquote>
<p>
If you don't deploy your app at your domain root <code>https://my-domain.com</code>, but at{' '}
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion docs/pages/markdown.page.server.mdx
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { RepoLink, Link } from '@brillout/docpress'

## Vue

If you use Vue, you can use [`vite-plugin-md`](https://github.com/antfu/vite-plugin-md).
If you use Vue, you can use [`unplugin-vue-markdown`](https://github.com/antfu/unplugin-vue-markdown), or [`vite-plugin-md`](https://github.com/antfu/vite-plugin-md) (make sure to use at least `vite-plugin-md@0.22.x`, see [this bug report](https://github.com/antfu/vite-plugin-md/issues/112#issuecomment-1353626379)).

Example:
- <RepoLink path='/examples/vue-full/vite.config.ts' />
4 changes: 2 additions & 2 deletions docs/pages/pre-rendering.page.server.mdx
Original file line number Diff line number Diff line change
@@ -44,15 +44,15 @@ export default {
}
```

Pre-render configuration: <Link href="/prerender-config" />.
List of options: <Link href="/prerender-config" />.

Your pages' HTML will be rendered when you run `$ vite build` and the generated HTML files are available at `dist/client/`.

For a page with a parameterized route (e.g. `/movie/@movieId`), you have to use the [`prerender()` hook](/prerender) in order to provide the list of URLs that are to be pre-rendered. The `prerender()` hook can also be used to accelerate the pre-rendering process.

By default, all pages are pre-rendered. To pre-render only some pages, use the <Link href="/prerender-config#partial" text={<><code>partial</code> option</>} /> with <Link href="/doNotPrerender" text={<code>.page.server.js#doNotPrerender</code>} />.

If you pre-render all your pages, then you can use Vite's CLI instead of a server (`$ vite dev`, `$ vite build`, and `$ vite preview`). See linked examples below.
If you pre-render all your pages, then you can use Vite's CLI instead of a server (`$ vite dev` and `$ vite preview`). See linked examples below.

You can programmatically invoke the pre-rendering process, see <Link href="/prerender-programmatic" />.

2 changes: 1 addition & 1 deletion docs/pages/redirect.page.server.mdx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ function onSomeHook() {
}
```

> `throw redirect()` makes temporary redirections (HTTP status code `302`). For permanent redirections (HTTP status code `301`) use <Link href="/redirects" noBreadcrumb={true} /> instead. (If you need programmatically defined permanent redirections then let us know: there is a hidden option to change the status code.)
> `throw redirect()` makes temporary redirections (HTTP status code `302`). For permanent redirections (HTTP status code `301`), you can set <Link href="/redirects" noBreadcrumb={true} /> or pass a second argument `throw redirect('/some-url', 301)`.
While it's most commonly used with [`guard()`](/guard) or [`onBeforeRender()`](/onBeforeRender) you can use it with any hook.

6 changes: 5 additions & 1 deletion docs/pages/redirects.page.server.mdx
Original file line number Diff line number Diff line change
@@ -17,7 +17,11 @@ export default {
redirects: {
'/about-us': '/about',
// Parameterized redirections
'/product/@id': '/buy/@id'
'/product/@id': '/buy/@id',
// Glob redirections
'/admin/*': '/private/*',
// External redirections
'/admin/*': 'https://admin.example.org/*'
}
})
]
7 changes: 5 additions & 2 deletions docs/pages/route-function.page.server.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Link } from '@brillout/docpress'

Route Functions enable full programmatic flexibility to implement advanced routing logic.
Route Functions give you full programmatic flexibility to define routes.

```js
// /pages/product/edit.page.route.js

import partRegex from 'part-regex'

export default (pageContext) => {
// Route guard
// Route guard (we can also use a guard() hook instead)
if (!pageContext.user.isAdmin) {
return false
}
@@ -26,9 +26,12 @@ export default (pageContext) => {
}
```

If you merely want to guard your page, then you can use a <Link text="Route String" href="/route-string" /> with a <Link text={<code>guard()</code>} href="/guard" /> hook instead of a Route Function, which is usually a better approach.

You can use any routing tool you want, such as:
- Vite-plugin-ssr's <Link text="Route String" href="/route-string" /> resolver [`resolveRoute()`](#resolveroute)
- [partRegex](https://github.com/brillout/part-regex)
- [path-to-regexp](https://www.npmjs.com/package/path-to-regexp) (the router used by Express.js)


## Precedence
2 changes: 1 addition & 1 deletion docs/pages/url-normalization.page.server.mdx
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export default {
plugins: [
ssr({
// Make URLs end with a trailing slash.
// For example: /some//path/ -> /some/path/
// For example: /some//path -> /some/path/
trailingSlash: true,

// Or completely disable automatic URL normalization.
2 changes: 1 addition & 1 deletion docs/utils/projectInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const PROJECT_VERSION = '0.4.140'
const PROJECT_VERSION = '0.4.141'

import React from 'react'

File renamed without changes.
2 changes: 1 addition & 1 deletion examples/auth/package.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"typescript": "^5.0.2",
"vike-react": "^0.1.6",
"vite": "^4.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
7 changes: 1 addition & 6 deletions examples/auth/pages/+config.h.ts
Original file line number Diff line number Diff line change
@@ -4,11 +4,6 @@ import vikeReact from 'vike-react'

export default {
Layout,
passToClient: [
'userFullName',
// https://github.com/vikejs/vike-react/issues/4
'pageProps',
'title'
],
passToClient: ['userFullName'],
extends: vikeReact
} satisfies Config
2 changes: 1 addition & 1 deletion examples/base-url-cdn-v1/package.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion examples/base-url-cdn/package.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion examples/base-url-server-v1/package.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion examples/base-url-server/package.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion examples/base-url-v1/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion examples/base-url/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.3",
"vite-plugin-ssr": "0.4.140"
"vite-plugin-ssr": "0.4.141"
},
"type": "module"
}
Loading