@pwa-platform/sw-runtime 0.4.2 → 0.4.3
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/README.md +4 -0
- package/dist/shared/url.d.ts.map +1 -1
- package/dist/shared/url.js +5 -1
- package/dist/shared/url.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -24,6 +24,10 @@ npm install @pwa-platform/sw-runtime
|
|
|
24
24
|
| `./platform-worker-entry` | 构建适配器 | 平台 worker 模板入口,不供页面直接 import |
|
|
25
25
|
| `./recovery-worker-entry` | 构建适配器 | 恢复 worker 模板入口,不供页面直接 import |
|
|
26
26
|
|
|
27
|
+
## 浏览器支持
|
|
28
|
+
|
|
29
|
+
本包在浏览器中运行的代码按平台最低版本检查:Safari 13.1、iOS Safari 13.4、Chrome 80、Edge 80、Firefox 74([ADR-0053](https://github.com/haigeerlab/pwa-platform/blob/main/docs/adr/0053-browser-compat-baseline.md))。在这些版本及以上,不会因新语法或缺失的内置 API 报错或解析失败;浏览器缺少的能力按不可用处理。这不表示所有 PWA 功能在这些版本上都可用,详见[兼容性参考](https://github.com/haigeerlab/pwa-platform/blob/main/website/reference/compatibility.md)。
|
|
30
|
+
|
|
27
31
|
## 平台 worker 行为
|
|
28
32
|
|
|
29
33
|
`registerPlatformWorker()` 会:
|
package/dist/shared/url.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/shared/url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/shared/url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CASjE"}
|
package/dist/shared/url.js
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export function canParseUrl(value, base) {
|
|
6
6
|
try {
|
|
7
|
-
new URL(value, base)
|
|
7
|
+
// Not `new URL(value, base)` with `base` undefined: Safari 13 throws for an explicit undefined base.
|
|
8
|
+
if (base === undefined)
|
|
9
|
+
new URL(value);
|
|
10
|
+
else
|
|
11
|
+
new URL(value, base);
|
|
8
12
|
return true;
|
|
9
13
|
}
|
|
10
14
|
catch {
|
package/dist/shared/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/shared/url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,IAAa;IACtD,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/shared/url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,IAAa;IACtD,IAAI,CAAC;QACH,qGAAqG;QACrG,IAAI,IAAI,KAAK,SAAS;YAAE,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;;YAClC,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pwa-platform/sw-runtime",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Service worker and recovery runtime for PWA Platform.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@pwa-platform/contracts": "0.4.
|
|
42
|
-
"@pwa-platform/engine-workbox": "0.4.
|
|
41
|
+
"@pwa-platform/contracts": "0.4.3",
|
|
42
|
+
"@pwa-platform/engine-workbox": "0.4.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@playwright/test": "1.63.0",
|
|
46
46
|
"@types/node": "24.13.4",
|
|
47
47
|
"vite": "8.3.0",
|
|
48
|
-
"@pwa-platform/
|
|
49
|
-
"@pwa-platform/
|
|
48
|
+
"@pwa-platform/core": "0.4.3",
|
|
49
|
+
"@pwa-platform/browser-test-harness": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=22.0.0"
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
"test:browser:real": "playwright test --config playwright.real.config.ts",
|
|
65
65
|
"test:browser:android": "playwright test --config playwright.android.config.ts",
|
|
66
66
|
"test:browser:ios": "playwright test --config playwright.ios.config.ts",
|
|
67
|
-
"typecheck": "tsc --noEmit --project tsconfig.json && tsc --noEmit --project tsconfig.worker.json && tsc --noEmit --project tsconfig.browser.json"
|
|
67
|
+
"typecheck": "tsc --noEmit --project tsconfig.json && tsc --noEmit --project tsconfig.worker.json && tsc --noEmit --project tsconfig.browser.json && tsc --noEmit --project tsconfig.floor.json"
|
|
68
68
|
}
|
|
69
69
|
}
|