-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin refactor #1236
Merged
dOrgJelli
merged 138 commits into
origin-0.10-dev
from
nerfzael-remove-plugins-from-core-and-client
Oct 24, 2022
Merged
Plugin refactor #1236
dOrgJelli
merged 138 commits into
origin-0.10-dev
from
nerfzael-remove-plugins-from-core-and-client
Oct 24, 2022
Conversation
This file contains 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
…d utils to helpers dir
remote
…tions Refactor ipfs exec options
…zael-client-and-config-renaming
…aming Client and config renaming
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:
noDefaults
there 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
,addPackages
methods to theClientConfigBuilder
, so users can add many items at once.buildDefault
to theClientConfigBuilder
which builds aClientConfig
using default resolvers.PluginPackage.from
manifest
and aPluginModule
or an inlinePluginModule
StaticResolver
andStaticResolver.from
to optimize building resolvers withIUriRedirect
,IUriWrapper
andIUriPackage
.PluginModule
is now imported fron plugin-js instead of core-jsBreaking changes:
noDefaults: false
no longer accepts aplugins
field, but it acceptswrappers
andpackages
.resolver
field has been replaced withresolvers
, since with default client the resolver used is theRecursiveResolver
with thePackageToWrapperCacheResolver
.noDefaults: true
, no longer accepts aplugins
field. It is expected that devs using this option will manually configure their own resolver.getPlugins
andgetPluginByUri
. Will addgetWrapper
,getWrapperByUri
,getPackage
,getPackageByUri
, in a follow up PR.createPolywrapClient
function has been deleted from the client-js package as it is unnecessaryCustomClientConfig
which doesn't haveplugins
and aresolver
, but now haswrappers
,packages
andresolvers
CustomClientConfig
, which can be used with defaults from thePolywrapClient
, but can not be used ifnoDefaults: true
is passed to thePolywrapClient
constructor.addPlugin
from theClientConfigBuilder
, users can now useaddWrapper
oraddPackage
where appropriate.addUriRedirect
toaddRedirect
to keep it inline withaddWrapper
andaddPackage
(IUriRedirect, IUriWrapper, IUriPackage)UriRedirect
toIUriRedirect
to matchIUriWrapper
andIUriPackage
IUriRedirect
,IUriWrapper
andIUriPackage
are now generic and their generic param implementsUri | string
options
argument fromclient.getManifest
method since all wrappers have a deserialized manifestplugins
on thePolywrapProvider
withwrappers
andpackages
buildUriResolver
withUriResolver.from
RecursiveResolver
andPackageToWrapperCacheResolver
now accept a concreteIUriResolver
while their staticfrom
methods accept aUriResolverLike
PluginsResolver
andPluginResolver
, users can now useWrapperResolver
orPackageResolver