@lynx-js/web-core-server-canary 0.17.1 → 0.17.2-canary-20250928-a35a2452
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/CHANGELOG.md +11 -9
- package/dist/index.js +11 -14
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @lynx-js/web-core-server
|
|
2
2
|
|
|
3
|
+
## 0.17.2-canary-20250928082931-a35a2452e5355bda3c475f9a750a86085e0cf56a
|
|
4
|
+
|
|
3
5
|
## 0.17.1
|
|
4
6
|
|
|
5
7
|
## 0.17.0
|
|
@@ -107,25 +109,25 @@
|
|
|
107
109
|
lynxView.initI18nResources = [
|
|
108
110
|
{
|
|
109
111
|
options: {
|
|
110
|
-
locale:
|
|
111
|
-
channel:
|
|
112
|
-
fallback_url:
|
|
112
|
+
locale: "en",
|
|
113
|
+
channel: "1",
|
|
114
|
+
fallback_url: "",
|
|
113
115
|
},
|
|
114
116
|
resource: {
|
|
115
|
-
hello:
|
|
116
|
-
lynx:
|
|
117
|
+
hello: "hello",
|
|
118
|
+
lynx: "lynx web platform1",
|
|
117
119
|
},
|
|
118
120
|
},
|
|
119
121
|
];
|
|
120
|
-
lynxView.addEventListener(
|
|
122
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
121
123
|
console.log(e);
|
|
122
124
|
});
|
|
123
125
|
|
|
124
126
|
// mts
|
|
125
127
|
_I18nResourceTranslation({
|
|
126
|
-
locale:
|
|
127
|
-
channel:
|
|
128
|
-
fallback_url:
|
|
128
|
+
locale: "en",
|
|
129
|
+
channel: "1",
|
|
130
|
+
fallback_url: "",
|
|
129
131
|
});
|
|
130
132
|
```
|
|
131
133
|
|
package/dist/index.js
CHANGED
|
@@ -738,35 +738,33 @@ class LynxCrossThreadContext extends EventTarget {
|
|
|
738
738
|
const currentSupportedTemplateVersion = 2;
|
|
739
739
|
const globalDisallowedVars = [
|
|
740
740
|
'navigator',
|
|
741
|
-
'postMessage'
|
|
741
|
+
'postMessage',
|
|
742
|
+
'window'
|
|
742
743
|
];
|
|
743
744
|
const templateUpgraders = [
|
|
744
745
|
(template)=>{
|
|
745
|
-
const defaultInjectStr = "Card,setTimeout,setInterval,clearInterval,clearTimeout,NativeModules,Component,ReactLynx,nativeAppId,Behavior,LynxJSBI,lynx,window,document,frames,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,fetch,XMLHttpRequest,__WebSocket__,webkit,Reporter,print,global,requestAnimationFrame,cancelAnimationFrame";
|
|
746
746
|
template.appType = template.appType ?? (template.lepusCode.root.startsWith('(function (globDynamicComponentEntry') ? 'lazy' : 'card');
|
|
747
|
-
template.manifest = Object.fromEntries(Object.entries(template.manifest).map(([key, value])=>[
|
|
748
|
-
key,
|
|
749
|
-
`module.exports={init: (lynxCoreInject) => { var {${defaultInjectStr}} = lynxCoreInject.tt; var module = {exports:{}}; var exports=module.exports; ${value}\n return module.exports; } }`
|
|
750
|
-
]));
|
|
751
747
|
template.version = 2;
|
|
748
|
+
template.lepusCode = Object.fromEntries(Object.entries(template.lepusCode).filter(([_, content])=>'string' == typeof content));
|
|
752
749
|
return template;
|
|
753
750
|
}
|
|
754
751
|
];
|
|
755
|
-
const generateModuleContent = (content, eager, appType)=>[
|
|
752
|
+
const generateModuleContent = (fileName, content, eager, appType)=>[
|
|
756
753
|
eager ? '//# allFunctionsCalledOnLoad' : '',
|
|
757
754
|
'\n(function() { "use strict"; const ',
|
|
758
755
|
globalDisallowedVars.join('=void 0,'),
|
|
759
756
|
'=void 0;\n',
|
|
760
757
|
'card' !== appType ? 'module.exports=\n' : '',
|
|
761
758
|
content,
|
|
762
|
-
'\n})()'
|
|
759
|
+
'\n})()',
|
|
760
|
+
'\n//# sourceURL=',
|
|
761
|
+
fileName
|
|
763
762
|
].join('');
|
|
764
763
|
async function generateJavascriptUrl(obj, createJsModuleUrl, eager, appType, templateName) {
|
|
765
|
-
|
|
764
|
+
return Promise.all(Object.entries(obj).filter(([_, content])=>'string' == typeof content).map(async ([name, content])=>[
|
|
766
765
|
name,
|
|
767
|
-
await createJsModuleUrl(generateModuleContent(content, eager, appType), `${templateName}-${name.replaceAll('/', '')}.js`)
|
|
768
|
-
];
|
|
769
|
-
return Promise.all(Object.entries(obj).filter(([_, content])=>'string' == typeof content).map(processEntry)).then(Object.fromEntries);
|
|
766
|
+
await createJsModuleUrl(generateModuleContent(`${templateName}/${name.replaceAll('/', '_')}.js`, content, eager, appType), `${templateName}-${name.replaceAll('/', '_')}.js`)
|
|
767
|
+
])).then(Object.fromEntries);
|
|
770
768
|
}
|
|
771
769
|
async function generateTemplate(template, createJsModuleUrl, templateName) {
|
|
772
770
|
template.version = template.version ?? 1;
|
|
@@ -775,8 +773,7 @@ async function generateTemplate(template, createJsModuleUrl, templateName) {
|
|
|
775
773
|
while(template.version < currentSupportedTemplateVersion && (upgrader = templateUpgraders[template.version - 1]))template = upgrader(template);
|
|
776
774
|
return {
|
|
777
775
|
...template,
|
|
778
|
-
lepusCode: await generateJavascriptUrl(template.lepusCode, createJsModuleUrl, true, template.appType, templateName)
|
|
779
|
-
manifest: await generateJavascriptUrl(template.manifest, createJsModuleUrl, false, template.appType, templateName)
|
|
776
|
+
lepusCode: await generateJavascriptUrl(template.lepusCode, createJsModuleUrl, true, template.appType, templateName)
|
|
780
777
|
};
|
|
781
778
|
}
|
|
782
779
|
function registerCallLepusMethodHandler(rpc, runtime) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-core-server-canary",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2-canary-20250928-a35a2452",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"rsbuild-plugin-arethetypeswrong": "0.1.1",
|
|
27
27
|
"rsbuild-plugin-publint": "0.3.3",
|
|
28
28
|
"@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
|
|
29
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.17.2-canary-20250928-a35a2452",
|
|
29
30
|
"@lynx-js/web-elements-template": "npm:@lynx-js/web-elements-template-canary@0.8.7",
|
|
30
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.
|
|
31
|
-
"@lynx-js/web-
|
|
32
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.1"
|
|
31
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.2-canary-20250928-a35a2452",
|
|
32
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.2-canary-20250928-a35a2452"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "rslib build",
|