extension-develop 4.1.12 → 4.1.14
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/dist/0~dev-server.mjs +147 -81
- package/dist/0~rspack-config.mjs +1098 -694
- package/dist/0~zip.mjs +1 -1
- package/dist/101.mjs +190 -900
- package/dist/129.mjs +89 -0
- package/dist/278.mjs +52 -0
- package/dist/292.mjs +61 -0
- package/dist/372.mjs +87 -0
- package/dist/518.mjs +434 -0
- package/dist/77.mjs +933 -0
- package/dist/80.mjs +6 -4
- package/dist/839.mjs +176 -39
- package/dist/845.mjs +10 -1
- package/dist/887.mjs +1 -1
- package/dist/bridge-entry.d.ts +2 -1
- package/dist/bridge.mjs +56 -7
- package/dist/css-parse-guard-loader.mjs +3 -0
- package/dist/dead-css-url-loader.mjs +51 -24
- package/dist/dev-server/cleanup.d.ts +2 -1
- package/dist/dev-server/control-bridge/broker.d.ts +1 -0
- package/dist/dev-server/control-bridge/contracts.d.ts +2 -0
- package/dist/dev-server/control-bridge/logs-query.d.ts +12 -1
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -1
- package/dist/dev-server/messages.d.ts +8 -0
- package/dist/dev-server/session-restart.d.ts +29 -0
- package/dist/ensure-hmr-for-scripts.js +37 -20
- package/dist/ensure-hmr-for-scripts.mjs +37 -20
- package/dist/extension-js-devtools/chrome/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chrome/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/chromium/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chromium/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/edge/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/edge/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/firefox/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/firefox/scripts/logger-client.js +1 -1
- package/dist/feature-scripts-classic-concat-loader.js +58 -5
- package/dist/feature-scripts-classic-concat-loader.mjs +58 -5
- package/dist/feature-scripts-content-script-wrapper.js +14 -17
- package/dist/feature-scripts-content-script-wrapper.mjs +14 -17
- package/dist/feature-scripts-native-geturl-import-loader.mjs +10 -3
- package/dist/lib/asset-source-maps.d.ts +7 -0
- package/dist/lib/config-loader.d.ts +7 -34
- package/dist/lib/loader-source-maps.d.ts +17 -0
- package/dist/lib/messages.d.ts +1 -0
- package/dist/lib/msg-placeholders.d.ts +2 -0
- package/dist/lib/paths.d.ts +2 -0
- package/dist/lib/project.d.ts +3 -0
- package/dist/lib/session-project-root.d.ts +1 -0
- package/dist/minimum-script-file.js +41 -1
- package/dist/minimum-script-file.mjs +41 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.mjs +1 -1
- package/dist/plugin-css/css-lib/dead-url-refs.d.ts +5 -0
- package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +32 -0
- package/dist/plugin-css/css-lib/messages.d.ts +3 -0
- package/dist/plugin-css/css-lib/verbatim-css.d.ts +9 -0
- package/dist/plugin-css/css-parse-guard-loader.d.ts +3 -0
- package/dist/plugin-css/css-tools/postcss.d.ts +1 -0
- package/dist/plugin-css/dead-css-url-loader.d.ts +8 -4
- package/dist/plugin-css/index.d.ts +1 -0
- package/dist/plugin-js-frameworks/js-frameworks-lib/jsx-transform.d.ts +10 -0
- package/dist/plugin-js-frameworks/js-tools/solid-jsx-runtime.d.ts +8 -0
- package/dist/plugin-js-frameworks/js-tools/solid.d.ts +3 -0
- package/dist/plugin-js-frameworks/swc-targets.d.ts +3 -0
- package/dist/plugin-reload/classify-reload.d.ts +6 -0
- package/dist/plugin-reload/index.d.ts +2 -1
- package/dist/plugin-reload/reload-dispatch.d.ts +1 -0
- package/dist/plugin-special-folders/folder-extensions/resolve-dirs.d.ts +1 -0
- package/dist/plugin-special-folders/folder-extensions/utils.d.ts +3 -0
- package/dist/plugin-special-folders/messages.d.ts +2 -0
- package/dist/plugin-special-folders/resolve-public-folder.d.ts +13 -0
- package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/html-lib/base-href.d.ts +11 -0
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +2 -2
- package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +13 -0
- package/dist/plugin-web-extension/feature-html/index.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/extract-action-theme-icons.d.ts +2 -0
- package/dist/plugin-web-extension/feature-icons/omnibox-fields.d.ts +2 -0
- package/dist/plugin-web-extension/feature-icons/theme-image-fields.d.ts +2 -0
- package/dist/plugin-web-extension/feature-json/json-validation.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/index.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/manifest.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/storage.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/theme.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +2 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/normalize-manifest-path.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-csp.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/native-geturl-import-loader.d.ts +7 -2
- package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
- package/dist/plugin-web-extension/index.d.ts +1 -0
- package/dist/plugin-web-extension/shared/html-surfaces.d.ts +19 -0
- package/dist/plugin-web-extension/shared/manifest-fields-change-detector.d.ts +1 -0
- package/dist/plugin-web-extension/shared/manifest-fields.d.ts +18 -0
- package/dist/plugin-web-extension/shared/manifest-path-assets.d.ts +4 -0
- package/dist/plugin-web-extension/shared/paths.d.ts +1 -0
- package/dist/solid-jsx-runtime.mjs +15 -0
- package/dist/types.d.ts +20 -7
- package/package.json +1 -1
- package/dist/494.mjs +0 -89
- package/dist/86.mjs +0 -36
|
@@ -3,6 +3,7 @@ import node_fs from "node:fs";
|
|
|
3
3
|
import node_path from "node:path";
|
|
4
4
|
import { init, parse } from "es-module-lexer";
|
|
5
5
|
import { validate } from "schema-utils";
|
|
6
|
+
import { returnWithMap, adjustLoaderSourceMap, inputOrIdentityMap } from "./292.mjs";
|
|
6
7
|
import { EXTENSIONJS_CONTENT_SCRIPT_LAYER } from "./291.mjs";
|
|
7
8
|
import { stripBom } from "./23.mjs";
|
|
8
9
|
import { toResourceKey } from "./93.mjs";
|
|
@@ -17,11 +18,22 @@ const schema = {
|
|
|
17
18
|
},
|
|
18
19
|
includeList: {
|
|
19
20
|
type: 'object'
|
|
21
|
+
},
|
|
22
|
+
frameworkOwnsRefresh: {
|
|
23
|
+
type: 'boolean'
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
additionalProperties: false
|
|
23
27
|
};
|
|
24
|
-
function ensureHMRForScripts(source) {
|
|
28
|
+
function ensureHMRForScripts(source, inputSourceMap) {
|
|
29
|
+
const withPrelude = (prelude)=>{
|
|
30
|
+
const resourcePath = String(this.resourcePath || '');
|
|
31
|
+
return adjustLoaderSourceMap(inputOrIdentityMap(inputSourceMap, resourcePath, source), {
|
|
32
|
+
prefix: prelude,
|
|
33
|
+
before: source,
|
|
34
|
+
after: source
|
|
35
|
+
});
|
|
36
|
+
};
|
|
25
37
|
const debugHtmlHmr = '1' === process.env.EXTENSION_DEBUG_HTML_HMR_SKIP;
|
|
26
38
|
const resourceQuery = String(this.resourceQuery || '');
|
|
27
39
|
if (resourceQuery.includes('vue&type=')) return source;
|
|
@@ -40,6 +52,15 @@ function ensureHMRForScripts(source) {
|
|
|
40
52
|
if (debugHtmlHmr) console.log(`[extjs:html-hmr] skip layer resource=${resourcePath} layer=${moduleLayer}`);
|
|
41
53
|
return source;
|
|
42
54
|
}
|
|
55
|
+
if (options?.frameworkOwnsRefresh === true) {
|
|
56
|
+
if (debugHtmlHmr) console.log(`[extjs:html-hmr] skip framework-refresh resource=${resourcePath}`);
|
|
57
|
+
return source;
|
|
58
|
+
}
|
|
59
|
+
const issuer = this?._module?.issuer;
|
|
60
|
+
if (issuer) {
|
|
61
|
+
if (debugHtmlHmr) console.log(`[extjs:html-hmr] skip child resource=${resourcePath}`);
|
|
62
|
+
return source;
|
|
63
|
+
}
|
|
43
64
|
try {
|
|
44
65
|
const manifestPath = String(options?.manifestPath || '');
|
|
45
66
|
const manifestDir = manifestPath ? node_path.dirname(manifestPath) : '';
|
|
@@ -55,23 +76,20 @@ function ensureHMRForScripts(source) {
|
|
|
55
76
|
if (debugHtmlHmr) console.log(`[extjs:html-hmr] skip direct resource=${resourcePath} manifest=${manifestPath}`);
|
|
56
77
|
return source;
|
|
57
78
|
}
|
|
58
|
-
let issuer = this?._module?.issuer;
|
|
59
|
-
while(issuer){
|
|
60
|
-
const issuerResource = String(issuer?.resource || issuer?.userRequest || '');
|
|
61
|
-
if (issuerResource && contentEntryPaths.has(toResourceKey(issuerResource))) {
|
|
62
|
-
if (debugHtmlHmr) console.log(`[extjs:html-hmr] skip issuer resource=${resourcePath} issuer=${issuerResource}`);
|
|
63
|
-
return source;
|
|
64
|
-
}
|
|
65
|
-
issuer = issuer?.issuer;
|
|
66
|
-
}
|
|
67
79
|
}
|
|
68
80
|
} catch (error) {
|
|
69
81
|
if (debugHtmlHmr) console.log(`[extjs:html-hmr] error resource=${resourcePath} manifest=${String(options?.manifestPath || '')} error=${error instanceof Error ? error.message : String(error)}`);
|
|
70
82
|
}
|
|
71
83
|
if (debugHtmlHmr) console.log(`[extjs:html-hmr] inject resource=${resourcePath} manifest=${String(options?.manifestPath || '')} layer=${moduleLayer || '<none>'}`);
|
|
72
84
|
const moduleType = String(this?._module?.type || '');
|
|
73
|
-
if ("javascript/dynamic" === moduleType)
|
|
74
|
-
|
|
85
|
+
if ("javascript/dynamic" === moduleType) {
|
|
86
|
+
const prelude = buildReloadCode('module.hot');
|
|
87
|
+
return returnWithMap(this, `${prelude}${source}`, withPrelude(prelude));
|
|
88
|
+
}
|
|
89
|
+
if ("javascript/esm" === moduleType) {
|
|
90
|
+
const prelude = buildReloadCode('import.meta.webpackHot');
|
|
91
|
+
return returnWithMap(this, `${prelude}${source}`, withPrelude(prelude));
|
|
92
|
+
}
|
|
75
93
|
const callback = this.async();
|
|
76
94
|
init.then(()=>{
|
|
77
95
|
let hasModuleSyntax = false;
|
|
@@ -79,9 +97,11 @@ function ensureHMRForScripts(source) {
|
|
|
79
97
|
const [, , , moduleSyntax] = parse(source);
|
|
80
98
|
hasModuleSyntax = Boolean(moduleSyntax);
|
|
81
99
|
} catch {}
|
|
82
|
-
|
|
100
|
+
const prelude = buildReloadCode(hasModuleSyntax ? 'import.meta.webpackHot' : 'module.hot');
|
|
101
|
+
callback(null, `${prelude}${source}`, withPrelude(prelude));
|
|
83
102
|
}).catch(()=>{
|
|
84
|
-
|
|
103
|
+
const prelude = buildReloadCode('module.hot');
|
|
104
|
+
callback(null, `${prelude}${source}`, withPrelude(prelude));
|
|
85
105
|
});
|
|
86
106
|
}
|
|
87
107
|
function buildReloadCode(hot) {
|
|
@@ -96,12 +116,9 @@ if (${hot}) {
|
|
|
96
116
|
while (el.firstChild) el.removeChild(el.firstChild);
|
|
97
117
|
};
|
|
98
118
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
roots.forEach(function(node) {
|
|
103
|
-
clear(node);
|
|
104
|
-
});
|
|
119
|
+
// The page mounts on #root; the version before must not stay
|
|
120
|
+
// underneath the one the entry renders next.
|
|
121
|
+
clear(document.getElementById('root'));
|
|
105
122
|
} catch (err) {
|
|
106
123
|
console.error('Error clearing HTML containers', err);
|
|
107
124
|
}
|