Minor Changes
-
feat:
nativeModulesUrl
of lynx-view is changed tonativeModulesMap
, and the usage is completely aligned withnapiModulesMap
. (#220)"warning: This is a breaking change."
nativeModulesMap
will be a map: key is module-name, value should be a esm url which export default a
function with two parameters(you never need to usethis
):-
NativeModules
: orientedNativeModules
, which you can use to call
other Native-Modules. -
NativeModulesCall
: triggeronNativeModulesCall
, same as the deprecatedthis.nativeModulesCall
.
example:
const nativeModulesMap = { CustomModule: URL.createObjectURL( new Blob( [ `export default function(NativeModules, NativeModulesCall) { return { async getColor(data, callback) { const color = await NativeModulesCall('getColor', data); callback(color); }, } };`, ], { type: 'text/javascript' }, ), ), }; lynxView.nativeModulesMap = nativeModulesMap;
In addition, we will use Promise.all to load
nativeModules
, which will optimize performance in the case of multiple modules. -
-
refractor: remove entryId concept (#217)
After the PR #198
All contents are isolated by a shadowroot.
Therefore we don't need to add the entryId selector to avoid the lynx-view's style taking effect on the whole page.
Patch Changes
-
refactor: remove customelement defined detecting logic (#247)
Before this commit, for those element with tag without
-
, we always try to detect if thex-${tagName}
is defined.After this commit, we pre-define a map(could be override by the
overrideLynxTagToHTMLTagMap
) to make that transformation for tag name.This change is a path to SSR and the MTS support.
-
Updated dependencies [
5b5e090
,b844e75
,53230f0
,6f16827
,d2d55ef
]:- @lynx-js/web-constants@0.9.0
- @lynx-js/web-mainthread-apis@0.9.0
- @lynx-js/web-worker-rpc@0.9.0