@wix/site-service-rendering-context 1.0.5 → 1.0.7
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/cjs/build/definition/index.d.ts +30 -0
- package/cjs/build/definition/index.js.map +1 -1
- package/cjs/build/index.js +3 -16
- package/cjs/build/index.js.map +1 -1
- package/dist/definition/index.d.ts +30 -0
- package/dist/definition/index.js.map +1 -1
- package/package.json +17 -7
- package/src/definition/index.ts +30 -0
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
import type { ServiceDefinition } from '@wix/services-definitions';
|
|
2
|
+
/** Values the host supplies when it creates the service. */
|
|
2
3
|
export type IRenderingContextServiceConfig = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the current page request comes from a search engine crawler.
|
|
6
|
+
*
|
|
7
|
+
* Default: `false`
|
|
8
|
+
*/
|
|
3
9
|
readonly seo?: boolean;
|
|
4
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Reports whether code is running without a browser window, and whether the page is rendering for
|
|
13
|
+
* a search engine crawler.
|
|
14
|
+
*/
|
|
5
15
|
export interface IRenderingContextService {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the code is running without a browser window, such as while the page renders on the server.
|
|
18
|
+
*
|
|
19
|
+
* This is `true` wherever there's no global `window`, which includes a web worker as well as the
|
|
20
|
+
* server. It's `false` in a browser window.
|
|
21
|
+
*
|
|
22
|
+
* It doesn't change while your code runs. It stays `true` for the whole server render, and `false`
|
|
23
|
+
* for as long as the page is open in the browser. Don't use it to choose what a component renders,
|
|
24
|
+
* because the server HTML won't match the browser render. Put browser-only work in an effect or an
|
|
25
|
+
* event handler instead.
|
|
26
|
+
*
|
|
27
|
+
* @exampleValue false
|
|
28
|
+
*/
|
|
6
29
|
readonly SSR: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the page is rendering for a search engine crawler.
|
|
32
|
+
*
|
|
33
|
+
* It's set for each page request, not by a site setting. It doesn't change while your code runs.
|
|
34
|
+
*
|
|
35
|
+
* @exampleValue false
|
|
36
|
+
*/
|
|
7
37
|
readonly SEO: boolean;
|
|
8
38
|
}
|
|
9
39
|
export type IRenderingContextDefinition = ServiceDefinition<IRenderingContextService, IRenderingContextServiceConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AA4C5C,QAAA,0BAA0B,GAAG,IAAA,oCAAa,EACtD,qCAAqC,CACrC,CAAA"}
|
package/cjs/build/index.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./definition"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./implementations"), exports);
|
|
19
6
|
//# sourceMappingURL=index.js.map
|
package/cjs/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,4DAAiC"}
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
import type { ServiceDefinition } from '@wix/services-definitions';
|
|
2
|
+
/** Values the host supplies when it creates the service. */
|
|
2
3
|
export type IRenderingContextServiceConfig = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the current page request comes from a search engine crawler.
|
|
6
|
+
*
|
|
7
|
+
* Default: `false`
|
|
8
|
+
*/
|
|
3
9
|
readonly seo?: boolean;
|
|
4
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Reports whether code is running without a browser window, and whether the page is rendering for
|
|
13
|
+
* a search engine crawler.
|
|
14
|
+
*/
|
|
5
15
|
export interface IRenderingContextService {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the code is running without a browser window, such as while the page renders on the server.
|
|
18
|
+
*
|
|
19
|
+
* This is `true` wherever there's no global `window`, which includes a web worker as well as the
|
|
20
|
+
* server. It's `false` in a browser window.
|
|
21
|
+
*
|
|
22
|
+
* It doesn't change while your code runs. It stays `true` for the whole server render, and `false`
|
|
23
|
+
* for as long as the page is open in the browser. Don't use it to choose what a component renders,
|
|
24
|
+
* because the server HTML won't match the browser render. Put browser-only work in an effect or an
|
|
25
|
+
* event handler instead.
|
|
26
|
+
*
|
|
27
|
+
* @exampleValue false
|
|
28
|
+
*/
|
|
6
29
|
readonly SSR: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the page is rendering for a search engine crawler.
|
|
32
|
+
*
|
|
33
|
+
* It's set for each page request, not by a site setting. It doesn't change while your code runs.
|
|
34
|
+
*
|
|
35
|
+
* @exampleValue false
|
|
36
|
+
*/
|
|
7
37
|
readonly SEO: boolean;
|
|
8
38
|
}
|
|
9
39
|
export type IRenderingContextDefinition = ServiceDefinition<IRenderingContextService, IRenderingContextServiceConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AA4CzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CACtD,qCAAqC,CACrC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/site-service-rendering-context",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -48,18 +48,29 @@
|
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsc -b . && tsc --project tsconfig.cjs.json",
|
|
51
|
-
"lint": "pnpm --workspace-root run lint:package --package $npm_package_name",
|
|
52
51
|
"test": "vitest --run && pnpm run test-type-check",
|
|
53
52
|
"test-type-check": "echo 'validating typescript in test files' && tsc --project tsconfig.test.json && echo 'Finished validating typescript in test files successfully'"
|
|
54
53
|
},
|
|
55
54
|
"dependencies": {
|
|
56
|
-
"@wix/services-definitions": "^0.
|
|
57
|
-
"@wix/services-manager": "^0.
|
|
55
|
+
"@wix/services-definitions": "^1.0.5",
|
|
56
|
+
"@wix/services-manager": "^1.0.7",
|
|
57
|
+
"tslib": "^2.8.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"typescript": "~7.0.2",
|
|
61
61
|
"vitest": "4.1.11"
|
|
62
62
|
},
|
|
63
|
+
"nx": {
|
|
64
|
+
"targets": {
|
|
65
|
+
"build": {
|
|
66
|
+
"outputs": [
|
|
67
|
+
"{projectRoot}/dist/**/*",
|
|
68
|
+
"{projectRoot}/cjs/build/**/*",
|
|
69
|
+
"{projectRoot}/*.tsbuildinfo"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
63
74
|
"publishUnscoped": false,
|
|
64
75
|
"wix": {
|
|
65
76
|
"artifact": {
|
|
@@ -72,10 +83,9 @@
|
|
|
72
83
|
},
|
|
73
84
|
"validations": {
|
|
74
85
|
"postBuild": [
|
|
75
|
-
"test"
|
|
76
|
-
"lint"
|
|
86
|
+
"test"
|
|
77
87
|
]
|
|
78
88
|
}
|
|
79
89
|
},
|
|
80
|
-
"falconPackageHash": "
|
|
90
|
+
"falconPackageHash": "bfb9d421e8a8df73993e05cbb45ad2d0a046ad3ac919aa0781864813"
|
|
81
91
|
}
|
package/src/definition/index.ts
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
import { defineService } from '@wix/services-definitions'
|
|
2
2
|
import type { ServiceDefinition } from '@wix/services-definitions'
|
|
3
3
|
|
|
4
|
+
/** Values the host supplies when it creates the service. */
|
|
4
5
|
export type IRenderingContextServiceConfig = {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the current page request comes from a search engine crawler.
|
|
8
|
+
*
|
|
9
|
+
* Default: `false`
|
|
10
|
+
*/
|
|
5
11
|
readonly seo?: boolean
|
|
6
12
|
}
|
|
7
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Reports whether code is running without a browser window, and whether the page is rendering for
|
|
16
|
+
* a search engine crawler.
|
|
17
|
+
*/
|
|
8
18
|
export interface IRenderingContextService {
|
|
19
|
+
/**
|
|
20
|
+
* Whether the code is running without a browser window, such as while the page renders on the server.
|
|
21
|
+
*
|
|
22
|
+
* This is `true` wherever there's no global `window`, which includes a web worker as well as the
|
|
23
|
+
* server. It's `false` in a browser window.
|
|
24
|
+
*
|
|
25
|
+
* It doesn't change while your code runs. It stays `true` for the whole server render, and `false`
|
|
26
|
+
* for as long as the page is open in the browser. Don't use it to choose what a component renders,
|
|
27
|
+
* because the server HTML won't match the browser render. Put browser-only work in an effect or an
|
|
28
|
+
* event handler instead.
|
|
29
|
+
*
|
|
30
|
+
* @exampleValue false
|
|
31
|
+
*/
|
|
9
32
|
readonly SSR: boolean
|
|
33
|
+
/**
|
|
34
|
+
* Whether the page is rendering for a search engine crawler.
|
|
35
|
+
*
|
|
36
|
+
* It's set for each page request, not by a site setting. It doesn't change while your code runs.
|
|
37
|
+
*
|
|
38
|
+
* @exampleValue false
|
|
39
|
+
*/
|
|
10
40
|
readonly SEO: boolean
|
|
11
41
|
}
|
|
12
42
|
|