From 67e3f2eac732137cdfd821345541e2657ea61cdc Mon Sep 17 00:00:00 2001 From: geopr Date: Tue, 16 Jul 2024 16:13:46 +0300 Subject: [PATCH 1/3] fix(core,core/session): taking an exisiting session instance instead of creating a new one while initializing the application --- CHANGELOG.md | 6 ++++++ src/core/index.ts | 3 +-- src/core/session/index.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e6ff3f775..d2b9f84f5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ #### :bug: Bug Fix +* Taking an exisiting `Session` instance instead of creating a new one while initializing the application `core`, `core/session` + +## v4.0.0-beta.?? (2024-??-??) + +#### :bug: Bug Fix + * `core/page-meta-data` is now expects description element to be a `meta` tag with the attribute `name='description'` instead of the `description` tag ## v4.0.0-beta.109 (2024-07-16) diff --git a/src/core/index.ts b/src/core/index.ts index ac69da457d..00d27291c7 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -18,7 +18,6 @@ import PageMetaData, { AbstractElementProperties } from 'core/page-meta-data'; import ThemeManager, { SystemThemeExtractorWeb } from 'core/theme-manager'; import * as session from 'core/session'; -import SessionEngine from 'core/session/engines'; export * as cookies from 'core/cookies'; export * as session from 'core/session'; @@ -50,7 +49,7 @@ if (SSR) { appProcessId: Object.fastHash(Math.random()), cookies: document, - session: session.from(SessionEngine), + session: session.globalSession, location: getLocationAPI(), pageMetaData: new PageMetaData(getLocationAPI(), getPageMetaElements()), diff --git a/src/core/session/index.ts b/src/core/session/index.ts index f5570964ff..ab6fc3db16 100644 --- a/src/core/session/index.ts +++ b/src/core/session/index.ts @@ -19,7 +19,7 @@ import type { SessionStore } from 'core/session/interface'; export * from 'core/session/class'; export * from 'core/session/interface'; -const globalSession = new Session(session); +export const globalSession = new Session(session); /** * Returns an API for managing the session of the specified store From 36dafed496ac9048eae480307a09ed154cda411f Mon Sep 17 00:00:00 2001 From: geopr Date: Tue, 16 Jul 2024 17:34:01 +0300 Subject: [PATCH 2/3] chore: :art: --- CHANGELOG.md | 4 ---- src/core/index.ts | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b9f84f5f..54be1fdd7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,10 +17,6 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ * Taking an exisiting `Session` instance instead of creating a new one while initializing the application `core`, `core/session` -## v4.0.0-beta.?? (2024-??-??) - -#### :bug: Bug Fix - * `core/page-meta-data` is now expects description element to be a `meta` tag with the attribute `name='description'` instead of the `description` tag ## v4.0.0-beta.109 (2024-07-16) diff --git a/src/core/index.ts b/src/core/index.ts index 00d27291c7..944523937d 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -49,6 +49,8 @@ if (SSR) { appProcessId: Object.fastHash(Math.random()), cookies: document, + + // FIXME: refactor core/session https://github.com/V4Fire/Client/issues/1329 session: session.globalSession, location: getLocationAPI(), From 3d53ed3324f165ee91e1073479eef95aad0d3669 Mon Sep 17 00:00:00 2001 From: Artem Shinkaruk Date: Tue, 16 Jul 2024 22:04:06 +0700 Subject: [PATCH 3/3] docs: fix changelog --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c1953775..bb3dd2c7a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,8 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ #### :bug: Bug Fix -* Taking an exisiting `Session` instance instead of creating a new one while initializing the application `core`, `core/session` - -* `core/page-meta-data` is now expects description element to be a `meta` tag with the attribute `name='description'` instead of the `description` tag - +* Set global `Session` instance in the application state in `core/index`. + It fixes the session events not being emitted in `core/init/dependencies/load-session`. * Fixed the bug where the event name was set as an event modifier in the `v-attrs` directive `component/directives/attrs` * Replaced the method calls to `componentCtx.$once` and `componentCtx.$on` with correct event handling based on the isOnceEvent flag in `component/directives/attrs` * The page description element is now expected to be a meta tag