DEV: Update content-tag to 1.2.1 (#24888)
This commit is contained in:
parent
b2c27a8c60
commit
057778b710
|
@ -1,29 +0,0 @@
|
|||
diff --git a/node_modules/content-tag/content_tag.js b/node_modules/content-tag/content_tag.js
|
||||
index e9be50d..9e20da2 100644
|
||||
--- a/node_modules/content-tag/content_tag.js
|
||||
+++ b/node_modules/content-tag/content_tag.js
|
||||
@@ -448,11 +448,17 @@ module.exports.__wbindgen_memory = function() {
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
-const path = require('path').join(__dirname, 'content_tag_bg.wasm');
|
||||
-const bytes = require('fs').readFileSync(path);
|
||||
-
|
||||
-const wasmModule = new WebAssembly.Module(bytes);
|
||||
-const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
-wasm = wasmInstance.exports;
|
||||
-module.exports.__wasm = wasm;
|
||||
+// Check for nodejs environment
|
||||
+if (process.version) {
|
||||
+ const path = require('path').join(__dirname, 'content_tag_bg.wasm');
|
||||
+ const bytes = require('fs').readFileSync(path);
|
||||
+
|
||||
+ const wasmModule = new WebAssembly.Module(bytes);
|
||||
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
+ wasm = wasmInstance.exports;
|
||||
+} else {
|
||||
+ const load = require('./content_tag_bg.wasm').default;
|
||||
+ wasm = load(imports);
|
||||
+ module.exports.__wasm = wasm;
|
||||
+}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
diff --git a/node_modules/content-tag/pkg/standalone.js b/node_modules/content-tag/pkg/standalone.js
|
||||
index 0df00d7..c19b607 100644
|
||||
--- a/node_modules/content-tag/pkg/standalone.js
|
||||
+++ b/node_modules/content-tag/pkg/standalone.js
|
||||
@@ -1,5 +1,6 @@
|
||||
-import init from "./standalone/content_tag.js";
|
||||
+import { initSync } from "./standalone/content_tag.js";
|
||||
+import module from "./standalone/content_tag_bg.wasm";
|
||||
|
||||
-await init();
|
||||
+initSync(module);
|
||||
|
||||
export { Preprocessor } from "./standalone/content_tag.js";
|
||||
diff --git a/node_modules/content-tag/pkg/standalone/content_tag.js b/node_modules/content-tag/pkg/standalone/content_tag.js
|
||||
index 70545cf..e6eb36b 100644
|
||||
--- a/node_modules/content-tag/pkg/standalone/content_tag.js
|
||||
+++ b/node_modules/content-tag/pkg/standalone/content_tag.js
|
||||
@@ -20,6 +20,7 @@ function takeObject(idx) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
+const { TextDecoder, TextEncoder } = require('util');
|
||||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
||||
|
||||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
@ -31,12 +31,7 @@ let wasmPlugin = {
|
|||
|
||||
build.onLoad({ filter: /.*/, namespace: "wasm-stub" }, async (args) => {
|
||||
return {
|
||||
contents: `import wasm from ${JSON.stringify(args.path)};
|
||||
export default (imports) => {
|
||||
const wasmModule = new WebAssembly.Module(wasm);
|
||||
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
return wasmInstance.exports;
|
||||
};`,
|
||||
contents: `export { default } from ${JSON.stringify(args.path)};`,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"@babel/standalone": "^7.23.6",
|
||||
"@zxing/text-encoding": "^0.9.0",
|
||||
"babel-plugin-ember-template-compilation": "^2.2.1",
|
||||
"content-tag": "^1.1.2",
|
||||
"content-tag": "^1.2.1",
|
||||
"discourse-common": "1.0.0",
|
||||
"discourse-widget-hbs": "1.0.0",
|
||||
"ember-cli-htmlbars": "^6.3.0",
|
||||
|
|
|
@ -4325,6 +4325,11 @@ content-tag@^1.1.2:
|
|||
resolved "https://registry.yarnpkg.com/content-tag/-/content-tag-1.1.2.tgz#a7adddfdd2d44c9418b795c91ee04c55f570a997"
|
||||
integrity sha512-AZkfc6TUmW+/RbZJioPzOQPAHHXqyqK4B0GNckJDjBAPK3SyGrMfn21bfFky/qwi5uoLph5sjAHUkO3CL6/IgQ==
|
||||
|
||||
content-tag@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/content-tag/-/content-tag-1.2.1.tgz#5bb23443d2ddf316657994fb333fdc1d4a161be8"
|
||||
integrity sha512-aKOsM+GojHMvRuqOa+qamATA3IEK9QksXcIX2NSGHpU5euNhrg6mZFT3Z7kDuNz55sH9NRPJKqeGhkhaq9ED2w==
|
||||
|
||||
content-type@~1.0.4:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918"
|
||||
|
|
|
@ -4325,6 +4325,11 @@ content-tag@^1.1.2:
|
|||
resolved "https://registry.yarnpkg.com/content-tag/-/content-tag-1.1.2.tgz#a7adddfdd2d44c9418b795c91ee04c55f570a997"
|
||||
integrity sha512-AZkfc6TUmW+/RbZJioPzOQPAHHXqyqK4B0GNckJDjBAPK3SyGrMfn21bfFky/qwi5uoLph5sjAHUkO3CL6/IgQ==
|
||||
|
||||
content-tag@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/content-tag/-/content-tag-1.2.1.tgz#5bb23443d2ddf316657994fb333fdc1d4a161be8"
|
||||
integrity sha512-aKOsM+GojHMvRuqOa+qamATA3IEK9QksXcIX2NSGHpU5euNhrg6mZFT3Z7kDuNz55sH9NRPJKqeGhkhaq9ED2w==
|
||||
|
||||
content-type@~1.0.4:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918"
|
||||
|
|
Loading…
Reference in New Issue