Plugin refactor#1236
Merged
dOrgJelli merged 138 commits intoorigin-0.10-devfrom Oct 24, 2022
Merged
Conversation
…d utils to helpers dir
remote
…tions Refactor ipfs exec options
…zael-client-and-config-renaming
…aming Client and config renaming
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.
Description:
The goal of this refactor is to remove plugins from the core-js, and client-js packages and improve their composability with resolvers
This PR introduces a new plugin-js package where the PluginWrapper and PluginPackage classes are located.
Features:
noDefaultsthere will be a separate PR that refactor core client functionality into a core-client package that does not depend on the config builder and uri-resolvers packages, but has no defaults.addRedirects,addWrappers,addPackagesmethods to theClientConfigBuilder, so users can add many items at once.buildDefaultto theClientConfigBuilderwhich builds aClientConfigusing default resolvers.PluginPackage.frommanifestand aPluginModuleor an inlinePluginModuleStaticResolverandStaticResolver.fromto optimize building resolvers withIUriRedirect,IUriWrapperandIUriPackage.PluginModuleis now imported fron plugin-js instead of core-jsBreaking changes:
noDefaults: falseno longer accepts apluginsfield, but it acceptswrappersandpackages.resolverfield has been replaced withresolvers, since with default client the resolver used is theRecursiveResolverwith thePackageToWrapperCacheResolver.noDefaults: true, no longer accepts apluginsfield. It is expected that devs using this option will manually configure their own resolver.getPluginsandgetPluginByUri. Will addgetWrapper,getWrapperByUri,getPackage,getPackageByUri, in a follow up PR.createPolywrapClientfunction has been deleted from the client-js package as it is unnecessaryCustomClientConfigwhich doesn't havepluginsand aresolver, but now haswrappers,packagesandresolversCustomClientConfig, which can be used with defaults from thePolywrapClient, but can not be used ifnoDefaults: trueis passed to thePolywrapClientconstructor.addPluginfrom theClientConfigBuilder, users can now useaddWrapperoraddPackagewhere appropriate.addUriRedirecttoaddRedirectto keep it inline withaddWrapperandaddPackage(IUriRedirect, IUriWrapper, IUriPackage)UriRedirecttoIUriRedirectto matchIUriWrapperandIUriPackageIUriRedirect,IUriWrapperandIUriPackageare now generic and their generic param implementsUri | stringoptionsargument fromclient.getManifestmethod since all wrappers have a deserialized manifestpluginson thePolywrapProviderwithwrappersandpackagesbuildUriResolverwithUriResolver.fromRecursiveResolverandPackageToWrapperCacheResolvernow accept a concreteIUriResolverwhile their staticfrommethods accept aUriResolverLikePluginsResolverandPluginResolver, users can now useWrapperResolverorPackageResolver