vitrify 0.14.2 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitrify",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "license": "MIT",
5
5
  "author": "Stefan van Herwijnen",
6
6
  "description": "Vite as your Full Stack development tool",
@@ -90,7 +90,7 @@
90
90
  "vue-router": "^4.2.5"
91
91
  },
92
92
  "peerDependencies": {
93
- "@fastify/static": "^6.12.0",
93
+ "@fastify/static": "^7.01",
94
94
  "fastify": "^4.26.0",
95
95
  "quasar": "^2.14.3",
96
96
  "vue": "^3.4.15",
@@ -2,10 +2,8 @@ import type { FastifyPluginAsync, FastifyRequest, FastifyReply } from 'fastify'
2
2
  import fastifyStatic from '@fastify/static'
3
3
  import { readFileSync } from 'fs'
4
4
  import { fileURLToPath } from 'url'
5
- import { componentsModules, collectCss } from '../../helpers/collect-css-ssr.js'
6
5
  import {
7
6
  addOrReplaceAppDiv,
8
- addOrReplaceTitle,
9
7
  appendToBody,
10
8
  appendToHead
11
9
  } from '../../helpers/utils.js'
@@ -1,7 +1,5 @@
1
1
  import type { FastifyInstance } from 'fastify'
2
2
  import fastify from 'fastify'
3
- import type { ViteDevServer } from 'vite'
4
- import { getCliDir, getCliViteDir } from '../../app-urls.js'
5
3
  import type { OnRenderedHook, OnSetupFile } from '../../vitrify-config.js'
6
4
  import type { FastifyCsrPlugin } from './fastify-csr-plugin.js'
7
5
  import type { FastifySsrPlugin } from './fastify-ssr-plugin.js'
@@ -1,17 +1,8 @@
1
- // import 'vitrify.sass'
2
1
  import createRouter from 'src/router'
3
- import {
4
- createSSRApp,
5
- createApp as createVueApp,
6
- h,
7
- onMounted as onMountedVue,
8
- getCurrentInstance,
9
- ref
10
- } from 'vue'
11
- import { onBoot, onMounted } from 'virtual:vitrify-hooks'
2
+ import { createSSRApp, createApp as createVueApp, ref } from 'vue'
3
+ import { onBoot } from 'virtual:vitrify-hooks'
12
4
  import routes from 'src/router/routes'
13
5
  import * as staticImports from 'virtual:static-imports'
14
- import App from 'src/App.vue'
15
6
 
16
7
  import RootComponent from './RootComponent.vue'
17
8
  interface ssrContext {
@@ -1,24 +1,20 @@
1
1
  import { createApp } from '../../../node/frameworks/vue/server.js'
2
2
  import { getAppDir } from '../../../node/app-urls.js'
3
- // import { setup } from 'virtual:fastify-setup'
4
3
  import { onSetup, onRendered } from 'virtual:vitrify-hooks'
5
4
  import { fastifySsrPlugin } from './fastify-ssr-plugin.js'
6
5
  import type { ViteDevServer } from 'vite'
7
6
 
8
- // const appDir = getPkgJsonDir(import.meta.url)
9
7
  const getString = (str?: string) => str
10
8
  let baseUrl = getString(__BASE_URL__)
11
9
  const appDir = getAppDir()
12
10
 
13
11
  export const setupApp = async () => {
14
- // const vitrifyDir = new URL('../', await resolve('vitrify', new URL(import.meta.url)))
15
12
  return createApp({
16
13
  onSetup,
17
14
  appDir,
18
15
  baseUrl,
19
16
  fastifyPlugin: fastifySsrPlugin,
20
17
  onRendered,
21
- // vitrifyDir,
22
18
  mode: import.meta.env.MODE
23
19
  })
24
20
  }
@@ -1,8 +1,6 @@
1
1
  import { createApp } from '../main'
2
2
 
3
- // const { app, router } = createApp()
4
3
  createApp('client').then(({ app, router }) => {
5
- // wait until router is ready before mounting to ensure hydration match
6
4
  router.isReady().then(() => {
7
5
  app.mount('#app')
8
6
  })
@@ -1,7 +1,4 @@
1
1
  import { createApp } from '../main'
2
- // import { renderToString } from 'vue/server-renderer'
3
-
4
- // import { onRendered } from 'virtual:vitrify-hooks'
5
2
 
6
3
  const initializeApp = async (url, ssrContext) => {
7
4
  const onRenderedList = []
@@ -14,7 +11,6 @@ const initializeApp = async (url, ssrContext) => {
14
11
  })
15
12
 
16
13
  const { app, router, routes } = await createApp('server', ssrContext)
17
- // set the router to the desired URL before rendering
18
14
 
19
15
  router.push({ path: url })
20
16
  ssrContext.initialState = {}