@live-change/peer-connection-frontend 0.2.51 → 0.2.53
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/front/src/App.vue +4 -3
- package/front/src/entry-server.js +5 -58
- package/front/vite.config.js +0 -1
- package/package.json +23 -24
- package/front/src/main.js +0 -60
package/front/src/App.vue
CHANGED
|
@@ -37,10 +37,11 @@ import 'primeicons/primeicons.css'
|
|
|
37
37
|
|
|
38
38
|
import ProgressSpinner from 'primevue/progressspinner'
|
|
39
39
|
|
|
40
|
-
import { useMeta } from 'vue-meta'
|
|
41
40
|
import Page from "./Page.vue"
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
import { computed } from 'vue'
|
|
43
|
+
import { useHead } from '@vueuse/head'
|
|
44
|
+
useHead(computed(() => ({
|
|
44
45
|
title: 'Title',
|
|
45
46
|
meta: [
|
|
46
47
|
{ charset: 'utf-8' },
|
|
@@ -52,7 +53,7 @@ const { meta } = useMeta({
|
|
|
52
53
|
lang: 'en',
|
|
53
54
|
amp: true
|
|
54
55
|
}
|
|
55
|
-
})
|
|
56
|
+
})))
|
|
56
57
|
|
|
57
58
|
import { ref } from 'vue'
|
|
58
59
|
const working = ref(false)
|
|
@@ -1,59 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { serverEntry } from '@live-change/frontend-base/server-entry.js'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
import { createRouter } from './router'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { createApp } from './main'
|
|
7
|
-
|
|
8
|
-
function escapeHtml(unsafe) {
|
|
9
|
-
return unsafe
|
|
10
|
-
.replace(/&/g, "&")
|
|
11
|
-
.replace(/</g, "<")
|
|
12
|
-
.replace(/>/g, ">")
|
|
13
|
-
.replace(/"/g, """)
|
|
14
|
-
.replace(/'/g, "'");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export async function render({ url, dao, windowId }) {
|
|
18
|
-
const api = await serverApi(dao, {
|
|
19
|
-
use: [ ]
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const { app, router } = createApp(api)
|
|
23
|
-
|
|
24
|
-
// set the router to the desired URL before rendering
|
|
25
|
-
router.push(url)
|
|
26
|
-
await router.isReady()
|
|
27
|
-
|
|
28
|
-
// prefetch data
|
|
29
|
-
await api.preFetchRoute(router.currentRoute, router)
|
|
30
|
-
|
|
31
|
-
// passing SSR context object which will be available via useSSRContext()
|
|
32
|
-
// @vitejs/plugin-vue injects code into a component's setup() that registers
|
|
33
|
-
// itself on ctx.modules. After the render, ctx.modules would contain all the
|
|
34
|
-
// components that have been instantiated during this render call.
|
|
35
|
-
const ctx = {}
|
|
36
|
-
const html = await renderToString(app, ctx)
|
|
37
|
-
await renderMetaToString(app, ctx)
|
|
38
|
-
|
|
39
|
-
const data = api.prerenderCache.cacheData()
|
|
40
|
-
//console.log("PRERENDER CACHE", Array.from(api.prerenderCache.cache.keys()))
|
|
41
|
-
//console.log("PRERENDER CACHE EXTENDED", Array.from(api.prerenderCache.extendedCache.keys()))
|
|
42
|
-
|
|
43
|
-
// the SSR manifest generated by Vite contains module -> chunk/asset mapping
|
|
44
|
-
// which we can then use to determine what files need to be preloaded for this
|
|
45
|
-
// request.
|
|
46
|
-
|
|
47
|
-
const metaManager = app.config.globalProperties.$metaManager
|
|
48
|
-
const activeMeta = metaManager.target.context.active
|
|
49
|
-
//console.log("ACTIVE META", activeMeta)
|
|
50
|
-
//console.log("TELEPORTS", ctx.teleports)
|
|
51
|
-
ctx.teleports.head = [
|
|
52
|
-
...(activeMeta.title ? [`<title data-vm-ssr="true">${escapeHtml(activeMeta.title)}</title>`] : []),
|
|
53
|
-
...((activeMeta.meta || []).map(meta => `<meta ${Object.keys(meta).map(
|
|
54
|
-
key => `${escapeHtml(key)}="${escapeHtml(meta[key])}"`
|
|
55
|
-
).join(' ')}>`))
|
|
56
|
-
].join('\n')
|
|
57
|
-
|
|
58
|
-
return { html, data, meta: ctx.teleports, modules: ctx.modules }
|
|
59
|
-
}
|
|
5
|
+
const render = serverEntry(App, createRouter, {})
|
|
6
|
+
export { render }
|
package/front/vite.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/peer-connection-frontend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.53",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "lcli memDev --enableSessions --initScript ./init.js",
|
|
6
6
|
"localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
|
|
@@ -20,48 +20,47 @@
|
|
|
20
20
|
"debug": "node --inspect-brk server"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@live-change/cli": "0.7.
|
|
23
|
+
"@live-change/cli": "0.7.30",
|
|
24
24
|
"@live-change/dao": "0.5.20",
|
|
25
25
|
"@live-change/dao-vue3": "0.5.20",
|
|
26
26
|
"@live-change/dao-websocket": "0.5.20",
|
|
27
|
-
"@live-change/framework": "0.7.
|
|
28
|
-
"@live-change/password-authentication-service": "0.3.
|
|
29
|
-
"@live-change/secret-code-service": "0.3.
|
|
30
|
-
"@live-change/secret-link-service": "0.3.
|
|
31
|
-
"@live-change/session-service": "0.3.
|
|
32
|
-
"@live-change/user-frontend": "^0.2.
|
|
33
|
-
"@live-change/user-service": "0.3.
|
|
27
|
+
"@live-change/framework": "0.7.30",
|
|
28
|
+
"@live-change/password-authentication-service": "0.3.29",
|
|
29
|
+
"@live-change/secret-code-service": "0.3.29",
|
|
30
|
+
"@live-change/secret-link-service": "0.3.29",
|
|
31
|
+
"@live-change/session-service": "0.3.29",
|
|
32
|
+
"@live-change/user-frontend": "^0.2.53",
|
|
33
|
+
"@live-change/user-service": "0.3.29",
|
|
34
34
|
"@live-change/vue3-components": "0.2.28",
|
|
35
35
|
"@live-change/vue3-ssr": "0.2.28",
|
|
36
|
-
"@vueuse/core": "^
|
|
36
|
+
"@vueuse/core": "^10.4.1",
|
|
37
37
|
"codeceptjs-assert": "^0.0.5",
|
|
38
38
|
"compression": "^1.7.4",
|
|
39
39
|
"cross-env": "^7.0.3",
|
|
40
40
|
"get-port-sync": "1.0.1",
|
|
41
|
-
"primeflex": "^3.3.
|
|
41
|
+
"primeflex": "^3.3.1",
|
|
42
42
|
"primeicons": "^6.0.1",
|
|
43
|
-
"primevue": "^3.
|
|
43
|
+
"primevue": "^3.34.1",
|
|
44
44
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
45
|
-
"rollup-plugin-visualizer": "5.
|
|
46
|
-
"serialize-javascript": "^6.0.
|
|
45
|
+
"rollup-plugin-visualizer": "5.9.2",
|
|
46
|
+
"serialize-javascript": "^6.0.1",
|
|
47
47
|
"serve-static": "^1.15.0",
|
|
48
|
-
"v-shared-element": "3.1.
|
|
49
|
-
"vue-
|
|
50
|
-
"vue-router": "^4.1.3",
|
|
48
|
+
"v-shared-element": "3.1.1",
|
|
49
|
+
"vue-router": "^4.2.4",
|
|
51
50
|
"vue3-scroll-border": "0.1.5"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@live-change/codeceptjs-helper": "0.7.
|
|
55
|
-
"@wdio/selenium-standalone-service": "^
|
|
56
|
-
"codeceptjs": "^3.
|
|
53
|
+
"@live-change/codeceptjs-helper": "0.7.30",
|
|
54
|
+
"@wdio/selenium-standalone-service": "^8.15.0",
|
|
55
|
+
"codeceptjs": "^3.5.4",
|
|
57
56
|
"generate-password": "1.7.0",
|
|
58
|
-
"playwright": "^1.
|
|
57
|
+
"playwright": "^1.37.1",
|
|
59
58
|
"random-profile-generator": "^2.3.0",
|
|
60
|
-
"txtgen": "^3.0.
|
|
61
|
-
"webdriverio": "^
|
|
59
|
+
"txtgen": "^3.0.6",
|
|
60
|
+
"webdriverio": "^8.16.6"
|
|
62
61
|
},
|
|
63
62
|
"author": "",
|
|
64
63
|
"license": "BSD-3-Clause",
|
|
65
64
|
"description": "",
|
|
66
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "55ef49d734bc2bd983010f862648e16aaf680d9f"
|
|
67
66
|
}
|
package/front/src/main.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { createSSRApp } from 'vue'
|
|
2
|
-
import { createMetaManager } from 'vue-meta'
|
|
3
|
-
|
|
4
|
-
import { registerComponents } from '@live-change/vue3-components'
|
|
5
|
-
import ReactiveDaoVue from '@live-change/dao-vue3'
|
|
6
|
-
|
|
7
|
-
import PrimeVue from 'primevue/config'
|
|
8
|
-
import ConfirmationService from 'primevue/confirmationservice'
|
|
9
|
-
import { PrimeVueConfirmSymbol } from 'primevue/useconfirm'
|
|
10
|
-
import { PrimeVueToastSymbol } from 'primevue/usetoast'
|
|
11
|
-
import ToastService from 'primevue/toastservice'
|
|
12
|
-
import StyleClass from 'primevue/styleclass'
|
|
13
|
-
import Ripple from 'primevue/ripple'
|
|
14
|
-
import BadgeDirective from 'primevue/badgedirective'
|
|
15
|
-
|
|
16
|
-
import App from './App.vue'
|
|
17
|
-
import { createRouter } from './router'
|
|
18
|
-
|
|
19
|
-
import emailValidator from "@live-change/email-service/clientEmailValidator.js"
|
|
20
|
-
import passwordValidator from "@live-change/password-authentication-service/clientPasswordValidator.js"
|
|
21
|
-
|
|
22
|
-
// SSR requires a fresh app instance per request, therefore we export a function
|
|
23
|
-
// that creates a fresh app instance. If using Vuex, we'd also be creating a
|
|
24
|
-
// fresh store here.
|
|
25
|
-
export function createApp(api) {
|
|
26
|
-
api.validators.email = emailValidator
|
|
27
|
-
api.validators.password = passwordValidator
|
|
28
|
-
|
|
29
|
-
const app = createSSRApp(App)
|
|
30
|
-
app.config.devtools = true
|
|
31
|
-
|
|
32
|
-
api.installInstanceProperties(app.config.globalProperties)
|
|
33
|
-
|
|
34
|
-
registerComponents(app)
|
|
35
|
-
app.use(ReactiveDaoVue, { dao: api })
|
|
36
|
-
|
|
37
|
-
const router = createRouter(app)
|
|
38
|
-
app.use(router)
|
|
39
|
-
|
|
40
|
-
app.use(PrimeVue, {
|
|
41
|
-
ripple: true
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
app.use(ConfirmationService)
|
|
45
|
-
app.provide(PrimeVueConfirmSymbol, app.config.globalProperties.$confirm)
|
|
46
|
-
|
|
47
|
-
app.use(ToastService)
|
|
48
|
-
app.provide(PrimeVueToastSymbol, app.config.globalProperties.$toast)
|
|
49
|
-
|
|
50
|
-
app.directive('styleclass', StyleClass)
|
|
51
|
-
app.directive('ripple', Ripple)
|
|
52
|
-
app.directive('badge', BadgeDirective)
|
|
53
|
-
|
|
54
|
-
const meta = createMetaManager({
|
|
55
|
-
isSSR: import.meta.env.SSR
|
|
56
|
-
})
|
|
57
|
-
app.use(meta)
|
|
58
|
-
|
|
59
|
-
return { app, router }
|
|
60
|
-
}
|