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.
Polywrap Origin (0.10.0)
Features
Toolchain
polywrapCLI:primaryJobto deploy manifest and outputURI.txtwhen runningpolywrap deployprimaryJoboption in the deploy manifest identifies the name of the job that is used for the primary deployment. The URI that is emitted from theprimaryJobwill be output to aURI.txtfile next to the deploy manifest.polywrap create templateCommandpolywrap create templatecommand to the CLI, enabling users to provide a url to a template project.--watchpolywrap codegen --watchwhich will automatically watch files within your project directory and re-run codegen whenever changes are detected.plugin/pythonprojects.plugin/rustprojects.--wrapper-envsoption, added to thebuild,codegen,docgen, andtestcommands.wasm/&interface/projects can now include aresources:directory, specified in thepolywrap.yamlmanifest. This resources directory will be copied into thebuild/folder upon runninpolywrap build. For example:-l, --log-file [path]option has been added to all commands. Its purpose is to configure aLog file to save console output to, useful in situations when the console log overflows.@polywrap/cli-js:polywrap/cli-jspackage to wrap thepolywrapCLI with a JavaScript/TypeScript interface.@polywrap/polywrap-manifest-schemas:0.3.0of thePolywrapManifest, which includes the newresources: stringfield.@polywrap/polywrap-manifest-types-js:0.3.0of thePolywrapManifest, which includes the newresources: stringfield.@polywrap/schema-bind:plugin/pythonprojects.wasm/rustBindings Now UseModuleTraitTraitwasm/rustwraps now generates aModuleTraittrait that must be implemented for the rootModulestruct.wasm/assemblyscriptBindings Now UseModuleBaseInterfacewasm/assemblyscriptwraps now generates aModuleBaseinterface that must be extended by a rootModuleclass.plugin/rustprojects.plugin-tsbindings, thePluginModuletype is now imported fron@polywrap/plugin-jsinstead of@polywrap/core-js.@polywrap/schema-compose:#import { Object, Module } from "wrap://..."JS Client
@polywrap/client-js:wrap://URIs.wrap://ens/uniswap.wraps.eth:v3wrap/WrapErrorstructure, helping debug common client error scenarios.validate(uri, options)method to thePolywrapClientclass, allowing users to guarantee the client can communicate with the provided wrapper located at the provided URI.@polywrap/client-config-builder-js:wrap://ens/wraps.eth:ens-text-record-uri-resolver-ext@1.0.0wrap://ens/wraps.eth:http-uri-resolver-ext@1.0.0wrap://ens/wraps.eth:file-system-uri-resolver-ext@1.0.0wrap://ens/wraps.eth:ens-uri-resolver-ext@1.0.0wrap://ens/wraps.eth:ens-ipfs-contenthash-uri-resolver-ext@1.0.0BuildOptionsto build method inIClientConfigBuilderipfs-http-client@wrap://ens/wraps.eth:ipfs-http-client@1.0.0async-ipfs-uri-resolver-ext@wrap://ens/wraps.eth:async-ipfs-uri-resolver-ext@1.0.1build(...)method now accepts a single argument of typeBuildOptions.wrap://ens/wrappers.polywrap.eth:concurrent@1.0.0interface, and adds theconcurrent-plugin-jspackage @wrap://plugin/concurrentas an implementation.wrap://ens/wrappers.polywrap.eth:logger@1.0.0interface, and adds the@polywrap/logger-plugin-jspackage @wrap://plugin/loggeras an implementation.ens-text-record-resolverto Default Config Bundleens-text-record-resolverwrapper @wrap://ipfs/QmfRCVA1MSAjUbrXXjya4xA9QHkbWeiKRsT7Um1cvrR7FYhas been added to the default client config bundle. This resolver enables ENS, text-record based, WRAP URI resolution. The text-record's key must be prepended with thewrap/...identifier. For example, the URIwrap://ens/domain.eth:foomaps todomain.eth'swrap/footext record. Thewrap/footext-record's value must contain another valid WRAP URI. For examples, see dev.polywrap.eth.addRedirects,addWrappers,addPackagesmethods to theClientConfigBuilder, so users can add many items at once.buildDefaultto theClientConfigBuilderwhich builds aClientConfigusing default resolvers.@polywrap/plugin-js:envToPluginModuleInvocation Method ArgumentsPluginModuleinvocation methods will now be given anenvthe method's arguments.PluginPackage.from.manifestand aPluginModule, or an inlinePluginModule.@polywrap/uri-resolvers-js:ResolutionResultCacheResolver.WrapperCacheResolver, which caches wrappers (URI => Wrapper), this resolver caches the result of the resolution process: URI, wrapper, package or error (URI => URI, URI => wrapper, URI => package, URI => error).RequestSynchronizerResolvercan be used to reuse parallel requests for the same URI, this way, only the first one needs to do the work (e.g. a network request) while others will await that same promise.StaticResolverandStaticResolver.fromto optimize building resolvers withIUriRedirect,IUriWrapperandIUriPackage.@polywrap/uri-resolver-extensions-js:ExtendableUriResolverhas been updated to get uri-resolver-ext implementations from the following interface URIs:wrap://ens/wraps.eth:uri-resolver-ext@1.1.0wrap://ens/wraps.eth:uri-resolver-ext@1.0.0@polywrap/core-js:WrapErrorstructure that improves debugging ability for common client error scenarios.GetImplementationsOptionsnow accepts an optional resolution context, to be used to handle infinite recursion when a resolver usesgetImplementationsGetImplementationsOptionsnow accepts an optionalapplyResolution. This can be used to apply URI resolution to interfaces.@polywrap/logging-js:@polywrap/logging-jsPackage@polywrap/logging-jspackage from the logging lib previously in the CLI's codebase.JS Plugins
@polywrap/http-plugin-js:formData: [FormDataEntry!]property on theRequestobject.Breaking Changes
Toolchain
polywrapCLI:keepBuilderoption which is default to false and removed the previousremoveBuilderoption from the build manifest.typescript-node&typescript-reactapp templates, and replace them with a singletypescript.polywrap.meta.yamlmanifest.--client-configoption has a new function entrypoint signature. Instead of exporting agetCustomConfigfunction, users should export the following:configure(builder: IClientConfigBuilder): IClientConfigBuilder.runtotestruncommand totest, which uses thetestproject extension, as defined in thepolywrap.test.yamlmanifest file.configsection from test manifestpolywrap.test.yaml) has been upgraded to version0.2.0with the following change:configsection insidestephas been removed, and manifest migrations will warn the user regarding this change.@polywrap/schema-bindwasm/rustBindings Now UseModuleTraitTraitimpl ModuleTrait for Module.wasm/assemblyscriptBindings Now UseModuleBaseInterfaceclass Modulewhichextends ModuleBase.@polywrap/test-env-jstest-env-jspackage has been deprecated, in favor of@polywrap/cli-jsJS Client
@polywrap/client-js:PolywrapClientPolywrapClientnow simply accepts aCoreClientConfig, which is expected to come from the config builder.client.query(...)&client.subscribe(...)methods.PolywrapClientconfig when usingnoDefaults: trueno longer acceptsredirects(Since redirects have been removed fromCoreClientConfig).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 deprecated.PolywrapClient's constructor now accepts only an optionalCoreClientConfigtype as its configuration object.ClientConfigBuilderfound in@polywrap/client-config-builder-jsand exported by@polywrap/client-jsin order to set up their client configurations.@polywrap/client-config-builder-js:BuilderConfigObjectClientConfigBuildernow uses a specificBuilderConfigthat is easier for users to work with. It will then be turned into aCoreClientConfigthrough the use of thebuild()method.ClientConfigBuilder.build()buildCoreConfig()tobuild(), which returns aCoreClientConfiginstance.wrap://ens/http.polywrap.ethinterface and wrapper have been removed from the default configuration bundle.wrap://ens/logger.core.polywrap.ethinterface and thewrap://ens/js-logger.polywrap.ethplugin wrapper have both been removed from the default configuration bundle.wrap://ens/ethereum.polywrap.ethURI + wrap has been removed from the default configuration bundle.wrap://ens/ipfs.polywrap.eth&wrap://ens/ipfs-resolver.polywrap.ethURIs + wraps have been removed from the default configuration bundle.buildCoreConfigno longer returns aCoreClientConfigwith redirects since redirects are no longer a part ofCoreClientConfig.removeUriRedirect(...)toremoveRedirePR-15epluginsand aresolver, but now haswrappers,packagesandresolvers`CustomClientConfig, 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.@polywrap/plugin-js:envProperty FromPluginModulePluginModuleinstances no longer have anenvproperty, and instead will be given anenvwithin the invocation method's arguments.@polywrap/core-js:CoreClientConfignowReadonlyUriMaps for itsinterfaceandenvproperties.redirectsare no longer a part ofCoreClientConfig.getRedirectsare no longer a part ofCoreClient.getUriResolveronCoreClienthas been renamed togetResolver.getImplementationsreturns a promise now.GetImplementationsOptionsno longer acceptsapplyRedirects. This has been replaces withapplyResolution.applyRedirectshelper function has been replaced withapplyResolution.UriRedirecttoIUriRedirectto matchIUriWrapperandIUriPackageIUriRedirect,IUriWrapperandIUriPackageare now generic and their generic param implementsUri | stringoptionsargument fromclient.getManifestmethod since all wrappers have a deserialized manifest@polywrap/uri-resolvers-js:PackageToWrapperCacheResolverInto Two ResolversPackageToWrapperCacheResolverhas been split into thePackageToWrapperResolver&WrapperCacheResolverresolvers.LegacyRedirectsResolverhas been removed.buildUriResolverwithUriResolver.fromRecursiveResolverandPackageToWrapperCacheResolvernow accept a concreteIUriResolverwhile their staticfrommethods accept aUriResolverLikePluginsResolverandPluginResolver, users can now useWrapperResolverorPackageResolver@polywrap/uri-resolver-extensions-js:ExtendableUriResolverno longer supports the legacy interface URIwrap://ens/uri-resolver.core.polywrap.eth.@polywrap/react:pluginson thePolywrapProviderwithwrappersandpackagesJS Plugins
@polywrap/http-plugin-js:@polywrap/fs-plugin-js:@polywrap/ws-plugin-js:@polywrap/ethereum-plugin-js:@polywrap/ipfs-plugin-js:Interface Wrappers
@polywrap/http-interface:@polywrap/file-system-interface:Bugs
Toolchain
polywrapCLI:polywrap buildOn Interface Projectstype: interfaceprojects, the CLI no longer requires docker to be running.polywrap testNon-Zero Exit Codespolywrap testnow exits with an exit code of 1 if a test fails.polywrap.build.yamlmanifest'slinked_packagesproperty.testcommand.wasm-interface-typescustom section, as a result of running wasm-bindgen. More information can be found here.ascUsingnpxascusingnpxto help with program resolution.--client-configoption.@polywrap/schema-bind:plugin/typescriptandapp/typescriptbindings now properly export all interfaces.wasm/rustbindings now useStringinstead ofstrwithin imported interface module typings.JS Client
@polywrap/core-js:WrapErrornow correctly parses Rust unwrap errors.unwrap()on a Rust result that contains an error, Rust will panic with an error message that contains the Err. For fidelity to the original Err, Rust inserts escape characters in the string. For example, "\n" becomes "\n". This behavior was not being handled correctly by WrapError's string parsing logic.@polywrap/uri-resolvers-extensions-js:nullURI Resolver Extension Return ResultsMaybeUriOrManifest&getFileinterfaces to properly reflect the URI resolver extension interface.Templates
@polywrap/templates:https://ipfs.wrappers.iogateway to the interface template'spolywrap.deploy.yamlmanifest.