Support for Moddable XS via injectable interface to access maps#13
Open
cmidgley wants to merge 2 commits intowessberg:masterfrom
Open
Support for Moddable XS via injectable interface to access maps#13cmidgley wants to merge 2 commits intowessberg:masterfrom
cmidgley wants to merge 2 commits intowessberg:masterfrom
Conversation
…to support Moddable), clear instances of singletons when re-registered, and add basic manifest.json for Moddable.
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.
In PR #12 (now closed), the suggestion was to expose a hook from DI to abstract access to the maps and remove Moddable-specific code from the implementation. This new PR takes that approach using the container constructor to optionally inject a storage implementation.
options?property on the container constructor, containing an optional injectable implementation for the container maps (customContainerMaps: IDIContainerMaps). When specified, it is used for container map access else it defaults to simple Maps as before.this.#containerMapsobject (which then has the three maps).optionsobject on the constructor and can easily make the behavior selectable.manifest.jsonfile as required Moddable to import and build.This is running well (with a custom Moddable map-hook and default hook for Node) across our code base, and passing all our tests.
Let me know if this approach is closer to what you were thinking or if we need to adjust further.