Skip to content

Commit 029b3e7

Browse files
committed
docs(readme): update window. to globalThis. for SSR compat
1 parent fc047a6 commit 029b3e7

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,11 @@ The current avatar shortcut strings available are "blue" (default), "gray",
418418
```
419419

420420
If you want to add to or override the shortcuts, you can set them via
421-
`window.$discordMessage.avatars` or by using the `setConfig` function
421+
`globalThis.$discordMessage.avatars` or by using the `setConfig` function
422422
(`import { setConfig } from '@skyra/discord-components-core'`).
423423

424424
```ts
425-
window.$discordMessage = {
425+
globalThis.$discordMessage = {
426426
avatars: {
427427
default: 'blue',
428428
skyra: 'https://github.com/NM-EEA-Y.png',
@@ -447,11 +447,11 @@ setConfig({
447447

448448
Sometimes you'll want to use the same message data across multiple messages. You
449449
can do so by providing an object of profiles in
450-
`window.$discordMessage.profiles` or by using the `setConfig` function
450+
`globalThis.$discordMessage.profiles` or by using the `setConfig` function
451451
(`import { setConfig } from '@skyra/discord-components-core'`).
452452

453453
```ts
454-
window.$discordMessage = {
454+
globalThis.$discordMessage = {
455455
profiles: {
456456
skyra: {
457457
author: 'Skyra',

assets/readme-templates/CORE_NOTES.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ The current avatar shortcut strings available are "blue" (default), "gray",
3535
```
3636

3737
If you want to add to or override the shortcuts, you can set them via
38-
`window.$discordMessage.avatars` or by using the `setConfig` function
38+
`globalThis.$discordMessage.avatars` or by using the `setConfig` function
3939
(`import { setConfig } from '@skyra/discord-components-core'`).
4040

4141
```ts
42-
window.$discordMessage = {
42+
globalThis.$discordMessage = {
4343
avatars: {
4444
default: 'blue',
4545
skyra: 'https://github.com/NM-EEA-Y.png',
@@ -64,11 +64,11 @@ setConfig({
6464

6565
Sometimes you'll want to use the same message data across multiple messages. You
6666
can do so by providing an object of profiles in
67-
`window.$discordMessage.profiles` or by using the `setConfig` function
67+
`globalThis.$discordMessage.profiles` or by using the `setConfig` function
6868
(`import { setConfig } from '@skyra/discord-components-core'`).
6969

7070
```ts
71-
window.$discordMessage = {
71+
globalThis.$discordMessage = {
7272
profiles: {
7373
skyra: {
7474
author: 'Skyra',

assets/readme-templates/REACT_NOTES.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ The current avatar shortcut strings available are "blue" (default), "gray",
3535
```
3636

3737
If you want to add to or override the shortcuts, you can set them via
38-
`window.$discordMessage.avatars` or by using the `setConfig` function
38+
`globalThis.$discordMessage.avatars` or by using the `setConfig` function
3939
(`import { setConfig } from '@skyra/discord-components-react'`).
4040

4141
```ts
42-
window.$discordMessage = {
42+
globalThis.$discordMessage = {
4343
avatars: {
4444
default: 'blue',
4545
skyra: 'https://github.com/NM-EEA-Y.png',
@@ -64,11 +64,11 @@ setConfig({
6464

6565
Sometimes you'll want to use the same message data across multiple messages. You
6666
can do so by providing an object of profiles in
67-
`window.$discordMessage.profiles` or by using the `setConfig` function
67+
`globalThis.$discordMessage.profiles` or by using the `setConfig` function
6868
(`import { setConfig } from '@skyra/discord-components-react'`).
6969

7070
```ts
71-
window.$discordMessage = {
71+
globalThis.$discordMessage = {
7272
profiles: {
7373
skyra: {
7474
author: 'Skyra',

packages/core/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ The current avatar shortcut strings available are "blue" (default), "gray",
426426
```
427427

428428
If you want to add to or override the shortcuts, you can set them via
429-
`window.$discordMessage.avatars` or by using the `setConfig` function
429+
`globalThis.$discordMessage.avatars` or by using the `setConfig` function
430430
(`import { setConfig } from '@skyra/discord-components-core'`).
431431

432432
```ts
433-
window.$discordMessage = {
433+
globalThis.$discordMessage = {
434434
avatars: {
435435
default: 'blue',
436436
skyra: 'https://github.com/NM-EEA-Y.png',
@@ -455,11 +455,11 @@ setConfig({
455455

456456
Sometimes you'll want to use the same message data across multiple messages. You
457457
can do so by providing an object of profiles in
458-
`window.$discordMessage.profiles` or by using the `setConfig` function
458+
`globalThis.$discordMessage.profiles` or by using the `setConfig` function
459459
(`import { setConfig } from '@skyra/discord-components-core'`).
460460

461461
```ts
462-
window.$discordMessage = {
462+
globalThis.$discordMessage = {
463463
profiles: {
464464
skyra: {
465465
author: 'Skyra',

packages/core/UPGRADING-TO-V4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Previously configuration of this library was only possible through configuring
134134
functions `getConfig` and `setConfig` to set the config. This is primarily
135135
because when using this library with server-side rendering the `window` object
136136
is not always available and it may not be possible to use
137-
`window.$discordMessage` to set the configuration.
137+
`globalThis.$discordMessage` to set the configuration.
138138

139139
### Component changes
140140

packages/core/demo/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
window.$discordMessage = {
1+
globalThis.$discordMessage = {
22
profiles: {
33
maximillian: {
44
author: 'Maximillian Osborn',

packages/documentation/astro.config.mts

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ export default defineConfig({
440440
{
441441
tag: 'script',
442442
content: `
443-
window.$discordMessage = {
443+
globalThis.$discordMessage = {
444444
profiles: {
445445
maximillian: {
446446
author: 'Maximillian Osborn',

packages/documentation/src/assets/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,11 @@ The current avatar shortcut strings available are "blue" (default), "gray",
317317
```
318318

319319
If you want to add to or override the shortcuts, you can set them via
320-
`window.$discordMessage.avatars` or by using the `setConfig` function
320+
`globalThis.$discordMessage.avatars` or by using the `setConfig` function
321321
(`import { setConfig } from '@skyra/discord-components-core'`).
322322

323323
```ts
324-
window.$discordMessage = {
324+
globalThis.$discordMessage = {
325325
avatars: {
326326
default: 'blue',
327327
skyra: 'https://github.com/NM-EEA-Y.png',
@@ -346,11 +346,11 @@ setConfig({
346346

347347
Sometimes you'll want to use the same message data across multiple messages. You
348348
can do so by providing an object of profiles in
349-
`window.$discordMessage.profiles` or by using the `setConfig` function
349+
`globalThis.$discordMessage.profiles` or by using the `setConfig` function
350350
(`import { setConfig } from '@skyra/discord-components-core'`).
351351

352352
```ts
353-
window.$discordMessage = {
353+
globalThis.$discordMessage = {
354354
profiles: {
355355
skyra: {
356356
author: 'Skyra',

packages/react/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ The current avatar shortcut strings available are "blue" (default), "gray",
233233
```
234234

235235
If you want to add to or override the shortcuts, you can set them via
236-
`window.$discordMessage.avatars` or by using the `setConfig` function
236+
`globalThis.$discordMessage.avatars` or by using the `setConfig` function
237237
(`import { setConfig } from '@skyra/discord-components-react'`).
238238

239239
```ts
240-
window.$discordMessage = {
240+
globalThis.$discordMessage = {
241241
avatars: {
242242
default: 'blue',
243243
skyra: 'https://github.com/NM-EEA-Y.png',
@@ -262,11 +262,11 @@ setConfig({
262262

263263
Sometimes you'll want to use the same message data across multiple messages. You
264264
can do so by providing an object of profiles in
265-
`window.$discordMessage.profiles` or by using the `setConfig` function
265+
`globalThis.$discordMessage.profiles` or by using the `setConfig` function
266266
(`import { setConfig } from '@skyra/discord-components-react'`).
267267

268268
```ts
269-
window.$discordMessage = {
269+
globalThis.$discordMessage = {
270270
profiles: {
271271
skyra: {
272272
author: 'Skyra',

0 commit comments

Comments
 (0)