Skip to content

Commit

Permalink
refactor: renderer/ => integration/ (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout authored Aug 25, 2024
1 parent a7a0f10 commit 5f8da51
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default {
require: {
'vike-vue': '>=0.7.0',
},
onCreateApp: 'import:vike-vue-pinia/renderer/installPinia:installPinia',
onAfterRenderHtml: 'import:vike-vue-pinia/renderer/dehydratePinia:dehydratePinia',
onBeforeRenderClient: 'import:vike-vue-pinia/renderer/hydratePinia:hydratePinia',
onCreateApp: 'import:vike-vue-pinia/__internal/integration/installPinia:installPinia',
onAfterRenderHtml: 'import:vike-vue-pinia/__internal/integration/dehydratePinia:dehydratePinia',
onBeforeRenderClient: 'import:vike-vue-pinia/__internal/integration/hydratePinia:hydratePinia',
} satisfies Config

declare global {
Expand Down
12 changes: 6 additions & 6 deletions packages/vike-vue-pinia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
},
"exports": {
"./config": "./dist/+config.js",
"./renderer/installPinia": "./dist/installPinia.js",
"./renderer/dehydratePinia": "./dist/dehydratePinia.js",
"./renderer/hydratePinia": "./dist/hydratePinia.js"
"./__internal/integration/installPinia": "./dist/installPinia.js",
"./__internal/integration/dehydratePinia": "./dist/dehydratePinia.js",
"./__internal/integration/hydratePinia": "./dist/hydratePinia.js"
},
"typesVersions": {
"*": {
"config": [
"./dist/+config.d.ts"
],
"renderer/installPinia": [
"__internal/integration/installPinia": [
"./dist/installPinia.d.ts"
],
"renderer/dehydratePinia": [
"__internal/integration/dehydratePinia": [
"./dist/dehydratePinia.d.ts"
],
"renderer/hydratePinia": [
"__internal/integration/hydratePinia": [
"./dist/hydratePinia.d.ts"
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default {
require: {
'vike-vue': '>=0.7.0',
},
onCreateApp: 'import:vike-vue-query/renderer/installVueQuery:installVueQuery',
onAfterRenderHtml: 'import:vike-vue-query/renderer/dehydrateVueQuery:dehydrateVueQuery',
onBeforeRenderClient: 'import:vike-vue-query/renderer/hydrateVueQuery:hydrateVueQuery',
onCreateApp: 'import:vike-vue-query/__internal/integration/installVueQuery:installVueQuery',
onAfterRenderHtml: 'import:vike-vue-query/__internal/integration/dehydrateVueQuery:dehydrateVueQuery',
onBeforeRenderClient: 'import:vike-vue-query/__internal/integration/hydrateVueQuery:hydrateVueQuery',
meta: {
queryClientConfig: {
env: {
Expand Down
12 changes: 6 additions & 6 deletions packages/vike-vue-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
},
"exports": {
"./config": "./dist/+config.js",
"./renderer/installVueQuery": "./dist/installVueQuery.js",
"./renderer/dehydrateVueQuery": "./dist/dehydrateVueQuery.js",
"./renderer/hydrateVueQuery": "./dist/hydrateVueQuery.js"
"./__internal/integration/installVueQuery": "./dist/installVueQuery.js",
"./__internal/integration/dehydrateVueQuery": "./dist/dehydrateVueQuery.js",
"./__internal/integration/hydrateVueQuery": "./dist/hydrateVueQuery.js"
},
"typesVersions": {
"*": {
"config": [
"./dist/+config.d.ts"
],
"renderer/installVueQuery": [
"__internal/integration/installVueQuery": [
"./dist/installVueQuery.d.ts"
],
"renderer/dehydrateVueQuery": [
"__internal/integration/dehydrateVueQuery": [
"./dist/dehydrateVueQuery.d.ts"
],
"renderer/hydrateVueQuery": [
"__internal/integration/hydrateVueQuery": [
"./dist/hydrateVueQuery.d.ts"
]
}
Expand Down
12 changes: 6 additions & 6 deletions packages/vike-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"types": "./dist/types/public.d.ts"
},
"./config": "./dist/+config.js",
"./renderer/onRenderHtml": "./dist/renderer/onRenderHtml.js",
"./renderer/onRenderClient": "./dist/renderer/onRenderClient.js"
"./__internal/integration/onRenderHtml": "./dist/integration/onRenderHtml.js",
"./__internal/integration/onRenderClient": "./dist/integration/onRenderClient.js"
},
"dependencies": {},
"peerDependencies": {
Expand Down Expand Up @@ -76,11 +76,11 @@
"clientOnly": [
"./dist/helpers/clientOnly.d.ts"
],
"renderer/onRenderHtml": [
"./dist/renderer/onRenderHtml.d.ts"
"__internal/integration/onRenderHtml": [
"./dist/integration/onRenderHtml.d.ts"
],
"renderer/onRenderClient": [
"./dist/renderer/onRenderClient.d.ts"
"__internal/integration/onRenderClient": [
"./dist/integration/onRenderClient.d.ts"
]
}
},
Expand Down
6 changes: 3 additions & 3 deletions packages/vike-vue/src/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { config }

import type { Config } from 'vike/types'
import './utils/tsx-workaround.js'
import { ssrEffect } from './renderer/ssrEffect.js'
import { ssrEffect } from './integration/ssrEffect.js'

const config = {
name: 'vike-vue',
Expand All @@ -11,9 +11,9 @@ const config = {
},

// https://vike.dev/onRenderHtml
onRenderHtml: 'import:vike-vue/renderer/onRenderHtml:onRenderHtml',
onRenderHtml: 'import:vike-vue/__internal/integration/onRenderHtml:onRenderHtml',
// https://vike.dev/onRenderClient
onRenderClient: 'import:vike-vue/renderer/onRenderClient:onRenderClient',
onRenderClient: 'import:vike-vue/__internal/integration/onRenderClient:onRenderClient',

// https://vike.dev/passToClient
// It is a cumulative config option, so a web app using vike-vue can extend
Expand Down
2 changes: 1 addition & 1 deletion packages/vike-vue/src/hooks/useConfig/useConfig-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { PageContextInternal } from '../../types/PageContext.js'
import type { ConfigFromHook } from '../../types/Config.js'
import { usePageContext } from '../usePageContext.js'
import { getPageContext } from 'vike/getPageContext'
import { applyHeadSettings } from '../../renderer/applyHeadSettings.js'
import { applyHeadSettings } from '../../integration/applyHeadSettings.js'
import { watchEffect } from 'vue'

function useConfig(): (config: ConfigFromHook) => void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function createVueApp(
const data = pageContext.data ?? {}
assertDataIsObject(data)
// TODO/breaking-change: use shallowRef() instead of shallowReactive()
// - Remove workaround https://github.com/vikejs/vike-vue/blob/89ca09ed18ffa1c0401851a506f505813a7dece7/packages/vike-vue/src/renderer/onRenderClient.ts#L18-L21
// - Remove workaround https://github.com/vikejs/vike-vue/blob/89ca09ed18ffa1c0401851a506f505813a7dece7/packages/vike-vue/src/integration/onRenderClient.ts#L18-L21
const dataReactive = shallowReactive(data)
const pageContextReactive = shallowReactive(pageContext)
setPageContext(app, pageContextReactive)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/vike-vue/src/types/Config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ImportString, PageContextServer, PageContext, PageContextClient } from 'vike/types'
import type { TagAttributes } from '../utils/getTagAttributesString'
import type { Viewport } from '../renderer/onRenderHtml'
import type { Viewport } from '../integration/onRenderHtml'
import type { ConfigsCumulative } from '../hooks/useConfig/configsCumulative'
import type { Component } from './PageContext'
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/vike-vue/src/types/PageContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type { Component }
import type { App } from 'vue'
import type { SSRContext } from 'vue/server-renderer'
import type { ConfigFromHookResolved } from './Config'
import type { PageHtmlStream } from '../renderer/onRenderHtml'
import type { PageHtmlStream } from '../integration/onRenderHtml'

// https://stackoverflow.com/questions/63985658/how-to-type-vue-instance-out-of-definecomponent-in-vue-3/63986086#63986086
// TODO: use ComponentPublicInstance
Expand Down
4 changes: 2 additions & 2 deletions packages/vike-vue/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default defineConfig({
lib: {
entry: {
['+config']: resolve(__dirname, './src/+config.ts'),
['renderer/onRenderClient']: resolve(__dirname, './src/renderer/onRenderClient.ts'),
['renderer/onRenderHtml']: resolve(__dirname, './src/renderer/onRenderHtml.ts'),
['integration/onRenderClient']: resolve(__dirname, './src/integration/onRenderClient.ts'),
['integration/onRenderHtml']: resolve(__dirname, './src/integration/onRenderHtml.ts'),
['helpers/clientOnly']: resolve(__dirname, './src/helpers/clientOnly.ts'),
['types/public']: resolve(__dirname, './src/types/public.ts'),
['hooks/usePageContext']: resolve(__dirname, './src/hooks/usePageContext.ts'),
Expand Down

0 comments on commit 5f8da51

Please sign in to comment.