Merged
Conversation
Add a mechanism for host apps to register custom API namespaces so that mini-programs can call qd.xxx() equivalently to wx.xxx(). - JS: env.js reads __diminaApiNamespaces and assigns globalApi to each name, with H5 fallback via Worker name - Android: DiminaConfig.addApiNamespace(), JsCore.evaluate(), MiniApp injects namespaces before service.js and exposes registerApi() - iOS: new DiminaConfig singleton, DMPApp injects namespaces in loadBundle() - HarmonyOS: new DiminaConfig singleton, DMPApp injects in startEngineService() - H5: jscore.js passes namespaces via Worker name property
…sting SDK entry points - iOS: add apiNamespaces to DMPAppManager with setup() method - HarmonyOS: add optional apiNamespaces param to DMPApp.init() - JS: merge dd/wx and custom namespace registration into one loop - Delete DiminaConfig.swift and DiminaConfig.ets
lbb00
added a commit
to EchoTechFE/dimina
that referenced
this pull request
Apr 7, 2026
* feat: support custom global API namespace (e.g. qd.xxx) Add a mechanism for host apps to register custom API namespaces so that mini-programs can call qd.xxx() equivalently to wx.xxx(). - JS: env.js reads __diminaApiNamespaces and assigns globalApi to each name, with H5 fallback via Worker name - Android: DiminaConfig.addApiNamespace(), JsCore.evaluate(), MiniApp injects namespaces before service.js and exposes registerApi() - iOS: new DiminaConfig singleton, DMPApp injects namespaces in loadBundle() - HarmonyOS: new DiminaConfig singleton, DMPApp injects in startEngineService() - H5: jscore.js passes namespaces via Worker name property * test(service): add unit tests for env.js API namespace registration * refactor: remove standalone DiminaConfig, attach apiNamespaces to existing SDK entry points - iOS: add apiNamespaces to DMPAppManager with setup() method - HarmonyOS: add optional apiNamespaces param to DMPApp.init() - JS: merge dd/wx and custom namespace registration into one loop - Delete DiminaConfig.swift and DiminaConfig.ets * fix(service): replace self with globalThis to pass oxlint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
支持用户自定义,比如 qd.foo 等同于 wx.foo