@fluentui/global-context 9.0.0-beta.92 → 9.0.0-beta.93
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/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
# Change Log - @fluentui/global-context
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 02 Oct 2025 15:06:59 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-beta.93](https://github.com/microsoft/fluentui/tree/@fluentui/global-context_v9.0.0-beta.93)
|
|
8
|
+
|
|
9
|
+
Thu, 02 Oct 2025 15:06:59 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/global-context_v9.0.0-beta.92..@fluentui/global-context_v9.0.0-beta.93)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- feat: enforce usage of use client directive for files with client-only features ([PR #35173](https://github.com/microsoft/fluentui/pull/35173) by dmytrokirpa@microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-context-selector to v9.2.8 ([PR #35133](https://github.com/microsoft/fluentui/pull/35133) by beachball)
|
|
16
|
+
- Bump @fluentui/react-utilities to v9.25.0 ([PR #35133](https://github.com/microsoft/fluentui/pull/35133) by beachball)
|
|
17
|
+
|
|
7
18
|
## [9.0.0-beta.92](https://github.com/microsoft/fluentui/tree/@fluentui/global-context_v9.0.0-beta.92)
|
|
8
19
|
|
|
9
|
-
Mon, 08 Sep 2025 12:42
|
|
20
|
+
Mon, 08 Sep 2025 12:51:42 GMT
|
|
10
21
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/global-context_v9.0.0-beta.91..@fluentui/global-context_v9.0.0-beta.92)
|
|
11
22
|
|
|
12
23
|
### Changes
|
package/lib/global-context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/global-context.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/global-context.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { GlobalObject } from './types';\nimport { getMajorVersion } from './utils';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser\n ? // eslint-disable-next-line @nx/workspace-no-restricted-globals\n window\n : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(\n defaultValue: T,\n name: string,\n packageName: string,\n packageVersion: string,\n): React.Context<T> => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = React.createContext<unknown>(defaultValue);\n }\n\n return globalObject[sym] as React.Context<T>;\n};\n"],"names":["React","canUseDOM","getMajorVersion","isBrowser","globalObject","window","global","SYMBOL_NAMESPACE","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","Symbol","keyFor","startsWith","createContext","defaultValue","name","packageName","packageVersion","for","includes"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,QAAQ,4BAA4B;AAEtD,SAASC,eAAe,QAAQ,UAAU;AAE1C,MAAMC,YAAYF;AAClB,MAAMG,eAA6BD,YAE/BE,SACAC;AAEJ,sFAAsF;AACtF,wDAAwD;AACxD,OAAO,MAAMC,mBAAmB,kBAAkB;AAElD,gEAAgE;AAChE,sEAAsE;AACtE,IAAI,CAACJ,aAAaK,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACvD,MAAMC,gBAAgBC,OAAOC,qBAAqB,CAACT;IACnDO,cAAcG,OAAO,CAACC,CAAAA;YAChBC;QAAJ,KAAIA,iBAAAA,OAAOC,MAAM,CAACF,kBAAdC,qCAAAA,eAAoBE,UAAU,CAACX,mBAAmB;YACpD,OAAOH,YAAY,CAACW,IAAI;QAC1B;IACF;AACF;AAEA;;;;;;;;;;;;CAYC,GACD,OAAO,MAAMI,gBAAgB,CAC3BC,cACAC,MACAC,aACAC;IAEA,wDAAwD;IACxD,MAAMR,MAAMC,OAAOQ,GAAG,CAAC,GAAGjB,mBAAmBe,YAAY,CAAC,EAAED,KAAK,EAAE,EAAEnB,gBAAgBqB,iBAAiB;IAEtG,8DAA8D;IAC9D,yEAAyE;IACzE,MAAMZ,gBAAgBC,OAAOC,qBAAqB,CAACT;IACnD,IAAI,CAACO,cAAcc,QAAQ,CAACV,MAAM;QAChC,8DAA8D;QAC9DX,YAAY,CAACW,IAAI,GAAGf,MAAMmB,aAAa,CAAUC;IACnD;IAEA,OAAOhB,YAAY,CAACW,IAAI;AAC1B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/global-context.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/global-context.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { GlobalObject } from './types';\nimport { getMajorVersion } from './utils';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser\n ? // eslint-disable-next-line @nx/workspace-no-restricted-globals\n window\n : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(\n defaultValue: T,\n name: string,\n packageName: string,\n packageVersion: string,\n): React.Context<T> => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = React.createContext<unknown>(defaultValue);\n }\n\n return globalObject[sym] as React.Context<T>;\n};\n"],"names":["SYMBOL_NAMESPACE","createContext","isBrowser","canUseDOM","globalObject","window","global","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","Symbol","keyFor","startsWith","defaultValue","name","packageName","packageVersion","for","getMajorVersion","includes","React"],"mappings":"AAAA;;;;;;;;;;;;IAeaA,gBAAgB;eAAhBA;;IA0BAC,aAAa;eAAbA;;;;iEAvCU;gCACG;uBAEM;AAEhC,MAAMC,YAAYC,IAAAA,yBAAS;AAC3B,MAAMC,eAA6BF,YAE/BG,SACAC;AAIG,MAAMN,mBAAmB;AAEhC,gEAAgE;AAChE,sEAAsE;AACtE,IAAI,CAACE,aAAaK,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACvD,MAAMC,gBAAgBC,OAAOC,qBAAqB,CAACR;IACnDM,cAAcG,OAAO,CAACC,CAAAA;YAChBC;QAAJ,KAAIA,iBAAAA,OAAOC,MAAM,CAACF,kBAAdC,qCAAAA,eAAoBE,UAAU,CAACjB,mBAAmB;YACpD,OAAOI,YAAY,CAACU,IAAI;QAC1B;IACF;AACF;AAeO,MAAMb,gBAAgB,CAC3BiB,cACAC,MACAC,aACAC;IAEA,wDAAwD;IACxD,MAAMP,MAAMC,OAAOO,GAAG,CAAC,GAAGtB,mBAAmBoB,YAAY,CAAC,EAAED,KAAK,EAAE,EAAEI,IAAAA,sBAAe,EAACF,iBAAiB;IAEtG,8DAA8D;IAC9D,yEAAyE;IACzE,MAAMX,gBAAgBC,OAAOC,qBAAqB,CAACR;IACnD,IAAI,CAACM,cAAcc,QAAQ,CAACV,MAAM;QAChC,8DAA8D;QAC9DV,YAAY,CAACU,IAAI,GAAGW,OAAMxB,aAAa,CAAUiB;IACnD;IAEA,OAAOd,YAAY,CAACU,IAAI;AAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/global-context",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.93",
|
|
4
4
|
"description": "Extension of React createContext to be a true singleton on the global scope",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"@fluentui/scripts-cypress": "*"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@fluentui/react-context-selector": "^9.2.
|
|
21
|
-
"@fluentui/react-utilities": "^9.
|
|
20
|
+
"@fluentui/react-context-selector": "^9.2.8",
|
|
21
|
+
"@fluentui/react-utilities": "^9.25.0",
|
|
22
22
|
"@swc/helpers": "^0.5.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|