diff --git a/dist/jsenv_core.js b/dist/jsenv_core.js index 2cfc3e7c83..342fcb2c8b 100644 --- a/dist/jsenv_core.js +++ b/dist/jsenv_core.js @@ -16646,6 +16646,31 @@ const jsenvPluginHtmlReferenceAnalysis = ({ actions.push(async () => { const inlineUrlInfo = inlineReference.urlInfo; await inlineUrlInfo.cook(); + const typeAttribute = getHtmlNodeAttribute(node, "type"); + if (expectedType === "js_classic") { + if ( + typeAttribute !== undefined && + typeAttribute !== "text/javascript" + ) { + // 1. @@ -16849,31 +16874,12 @@ const jsenvPluginHtmlReferenceAnalysis = ({ ) { return; } - - const inlineRef = visitTextContent(scriptNode, { + visitTextContent(scriptNode, { type: "script", subtype, expectedType: type, contentType, }); - if (inlineRef) { - // 1. - - - \ No newline at end of file diff --git a/packages/related/plugin-preact/tests/script_module_jsx/_script_module_jsx_dev.test.mjs/0_chromium/0_chromium.md b/packages/related/plugin-preact/tests/script_module_jsx/_script_module_jsx_dev.test.mjs/0_chromium/0_chromium.md index 4b01674660..4b7a1c8e7c 100644 --- a/packages/related/plugin-preact/tests/script_module_jsx/_script_module_jsx_dev.test.mjs/0_chromium/0_chromium.md +++ b/packages/related/plugin-preact/tests/script_module_jsx/_script_module_jsx_dev.test.mjs/0_chromium/0_chromium.md @@ -1,4 +1,4 @@ -# [0_chromium](../../script_module_jsx_dev.test.mjs#L20) +# [0_chromium](../../script_module_jsx_dev.test.mjs#L24) ```js run({ browserLauncher: chromium }) diff --git a/packages/related/plugin-preact/tests/script_module_jsx/client/main.html b/packages/related/plugin-preact/tests/script_module_jsx/client/main.html index ac97101dfd..3d450a9b96 100644 --- a/packages/related/plugin-preact/tests/script_module_jsx/client/main.html +++ b/packages/related/plugin-preact/tests/script_module_jsx/client/main.html @@ -3,6 +3,7 @@ Title + @@ -12,28 +13,28 @@ window.resolveResultPromise = resolve; }); - diff --git a/packages/related/plugin-preact/tests/script_module_jsx/script_module_jsx.test_manual.js b/packages/related/plugin-preact/tests/script_module_jsx/script_module_jsx.test_manual.js new file mode 100644 index 0000000000..bcd20d3262 --- /dev/null +++ b/packages/related/plugin-preact/tests/script_module_jsx/script_module_jsx.test_manual.js @@ -0,0 +1,13 @@ +import { startDevServer } from "@jsenv/core"; +import { jsenvPluginPreact } from "@jsenv/plugin-preact"; + +await startDevServer({ + sourceDirectoryUrl: new URL("./client/", import.meta.url), + port: 3457, + ribbon: false, + plugins: [ + jsenvPluginPreact({ + refreshInstrumentation: true, + }), + ], +}); diff --git a/packages/related/plugin-preact/tests/script_module_jsx/script_module_jsx_dev.test.mjs b/packages/related/plugin-preact/tests/script_module_jsx/script_module_jsx_dev.test.mjs index 240925337f..a2a3f02dae 100644 --- a/packages/related/plugin-preact/tests/script_module_jsx/script_module_jsx_dev.test.mjs +++ b/packages/related/plugin-preact/tests/script_module_jsx/script_module_jsx_dev.test.mjs @@ -9,7 +9,11 @@ const run = async ({ browserLauncher }) => { sourceDirectoryUrl: new URL("./client/", import.meta.url), keepProcessAlive: false, port: 0, - plugins: [jsenvPluginPreact()], + plugins: [ + jsenvPluginPreact({ + refreshInstrumentation: true, + }), + ], }); return executeHtml(`${devServer.origin}/main.html`, { browserLauncher, diff --git a/packages/related/plugin-react/package.json b/packages/related/plugin-react/package.json index cd59c345ec..c41a5df5c0 100644 --- a/packages/related/plugin-react/package.json +++ b/packages/related/plugin-react/package.json @@ -1,6 +1,6 @@ { "name": "@jsenv/plugin-react", - "version": "1.5.47", + "version": "1.5.48", "license": "MIT", "repository": { "type": "git", @@ -23,7 +23,7 @@ "dependencies": { "@babel/plugin-transform-react-jsx": "7.25.9", "@babel/plugin-transform-react-jsx-development": "7.25.9", - "@jsenv/ast": "6.3.7", + "@jsenv/ast": "6.4.0", "@jsenv/plugin-commonjs": "2.9.2", "@jsenv/sourcemap": "1.2.27", "@jsenv/url-meta": "8.5.2", diff --git a/packages/related/plugin-toolbar/package.json b/packages/related/plugin-toolbar/package.json index 4b34d53172..8d04dbd906 100644 --- a/packages/related/plugin-toolbar/package.json +++ b/packages/related/plugin-toolbar/package.json @@ -1,6 +1,6 @@ { "name": "@jsenv/plugin-toolbar", - "version": "1.4.26", + "version": "1.4.27", "license": "MIT", "repository": { "type": "git", @@ -26,7 +26,7 @@ "/src/" ], "dependencies": { - "@jsenv/ast": "6.3.7", + "@jsenv/ast": "6.4.0", "@preact/signals": "1.3.0" }, "scripts": { diff --git a/packages/related/test/package.json b/packages/related/test/package.json index 5e659107a1..0a58748efd 100644 --- a/packages/related/test/package.json +++ b/packages/related/test/package.json @@ -1,6 +1,6 @@ { "name": "@jsenv/test", - "version": "3.5.28", + "version": "3.5.29", "license": "MIT", "repository": { "type": "git", @@ -37,13 +37,13 @@ "dependencies": { "@c88/v8-coverage": "0.1.1", "@jsenv/abort": "4.3.0", - "@jsenv/ast": "6.3.7", + "@jsenv/ast": "6.4.0", "@jsenv/exception": "1.1.3", "@jsenv/filesystem": "4.10.13", "@jsenv/github-check-run": "0.2.5", "@jsenv/node-esm-resolution": "1.0.6", "@jsenv/humanize": "1.2.8", - "@jsenv/plugin-supervisor": "1.5.30", + "@jsenv/plugin-supervisor": "1.5.31", "@jsenv/sourcemap": "1.2.27", "@jsenv/url-meta": "8.5.2", "@jsenv/urls": "2.5.4", diff --git a/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js b/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js index 9d706a02b9..eb5ab2f9b4 100644 --- a/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js +++ b/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js @@ -280,6 +280,31 @@ export const jsenvPluginHtmlReferenceAnalysis = ({ actions.push(async () => { const inlineUrlInfo = inlineReference.urlInfo; await inlineUrlInfo.cook(); + const typeAttribute = getHtmlNodeAttribute(node, "type"); + if (expectedType === "js_classic") { + if ( + typeAttribute !== undefined && + typeAttribute !== "text/javascript" + ) { + // 1. @@ -483,31 +508,12 @@ export const jsenvPluginHtmlReferenceAnalysis = ({ ) { return; } - - const inlineRef = visitTextContent(scriptNode, { + visitTextContent(scriptNode, { type: "script", subtype, expectedType: type, contentType, }); - if (inlineRef) { - // 1.