Skip to content

Polywrap Origin (0.10.0)

Compare
Choose a tag to compare
@github-actions github-actions released this 14 Apr 05:10
7135371

Polywrap Origin (0.10.0)

Features

Toolchain

polywrap CLI:

  • PR-1592 Add primaryJob to deploy manifest and output URI.txt when running polywrap deploy
    • The primaryJob option in the deploy manifest identifies the name of the job that is used for the primary deployment. The URI that is emitted from the primaryJob will be output to a URI.txt file next to the deploy manifest.
  • PR-1529 polywrap create template Command
    • Added the polywrap create template command to the CLI, enabling users to provide a url to a template project.
  • PR-1584 Codegen Command Now Supports --watch
    • You can now run npx polywrap codegen --watch which will automatically watch files within your project directory and re-run codegen whenever changes are detected.
  • PR-1677 Python Plugin Support
    • Add bindings for plugin/python projects.
  • PR-1428 Rust Plugin Support
    • Add bindings for plugin/rust projects.
  • PR-1437 Support Custom Wrapper Environment Variables
    • Enable users to customize the CLI's internal client's wrapper environment via a --wrapper-envs option, added to the build, codegen, docgen, and test commands.
  • PR-1430 Support Arbitrary Resources Files
    • Polywrap wasm/ & interface/ projects can now include a resources: directory, specified in the polywrap.yaml manifest. This resources directory will be copied into the build/ folder upon runnin polywrap build. For example:
      format: 0.3.0
      project:
        type: interface | wasm/...
        ...
      source:
        ...
      resources: ./resources
  • PR-1349 Log File Support
    • A -l, --log-file [path] option has been added to all commands. Its purpose is to configure a Log file to save console output to, useful in situations when the console log overflows.

@polywrap/cli-js:

  • PR-1359 Polywrap CLI JS Wrapper
    • Created the polywrap/cli-js package to wrap the polywrap CLI with a JavaScript/TypeScript interface.

@polywrap/polywrap-manifest-schemas:

  • PR-1430 Support Arbitrary Resources Files
    • Added version 0.3.0 of the PolywrapManifest, which includes the new resources: string field.

@polywrap/polywrap-manifest-types-js:

  • PR-1379 Add Logging to Manifest Migrators
    • Added an optional logger parameter to the deserialization function of all manifest types.
  • PR-1430 Support Arbitrary Resources Files
    • Added version 0.3.0 of the PolywrapManifest, which includes the new resources: string field.

@polywrap/schema-bind:

  • PR-1677 Python Plugin Support
    • Add bindings for plugin/python projects.
  • PR-1464 wasm/rust Bindings Now Use ModuleTrait Trait
    • Codegen for wasm/rust wraps now generates a ModuleTrait trait that must be implemented for the root Module struct.
  • PR-1460 wasm/assemblyscript Bindings Now Use ModuleBase Interface
    • Codegen for wasm/assemblyscript wraps now generates a ModuleBase interface that must be extended by a root Module class.
  • PR-1428 Rust Plugin Support
    • Add bindings for plugin/rust projects.
  • PR-1236 Plugin Refactor
    • In plugin-ts bindings, the PluginModule type is now imported fron @polywrap/plugin-js instead of @polywrap/core-js.

@polywrap/schema-compose:

  • PR-1600 Allow WRAP URIs in Un-Namespaced Imports
    • Support URIs within un-namespaced import statements like so #import { Object, Module } from "wrap://..."
    • This effectively enables the "embedding" of external ABIs, which is useful when you'd like to copy 1:1 an ABI that lives elsewhere.

JS Client

@polywrap/client-js:

  • PR-1582 Support ENS Text Record WRAP URIs
    • Support has been added for using ENS text records as valid wrap:// URIs.
    • Example: wrap://ens/uniswap.wraps.eth:v3
    • NOTE: Text record key names must begin with wrap/
  • PR-1431 WRAP Error Structure
    • Integrate the WrapError structure, helping debug common client error scenarios.
  • PR-1340 Wrapper Validation
    • Added a validate(uri, options) method to the PolywrapClient class, allowing users to guarantee the client can communicate with the provided wrapper located at the provided URI.
  • PR-1236 Plugin Refactor
    • Polywrap Client now re-exports the config builder and uri-resolvers (in addition to core) packages. This is done to improve dev exp and remove the need for users to import those package themselves.
      • For users who do not need those packages and are using 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.

@polywrap/client-config-builder-js:

  • PR-1582 Integrate URI Resolver Extension Wraps
  • PR-1560 Add BuildOptions to build method in IClientConfigBuilder
    • This makes it possible to add a custom cache or resolver without casting.
  • PR-1475 Embed IPFS HTTP Client & IPFS URI Resolver Wraps
    • The default configuration bundle now comes with two embedded wraps that enable interactions with IPFS:
  • PR-1518 Optional Build Method Arguments
    • The build(...) method now accepts a single argument of type BuildOptions.
  • PR-1496 Use New Concurrent Wrapper
    • The default config bundle now uses the wrap://ens/wrappers.polywrap.eth:[email protected] interface, and adds the concurrent-plugin-js package @ wrap://plugin/concurrent as an implementation.
  • PR-1468 Export Default Config Bundle URIs
    • The default config now exports constants for all URIs used within the config.
  • PR-1436 Use New Logger Wrapper
    • The default config bundle now uses the wrap://ens/wrappers.polywrap.eth:[email protected] interface, and adds the @polywrap/logger-plugin-js package @ wrap://plugin/logger as an implementation.
  • PR-1411 Add ens-text-record-resolver to Default Config Bundle
    • The ens-text-record-resolver wrapper @ wrap://ipfs/QmfRCVA1MSAjUbrXXjya4xA9QHkbWeiKRsT7Um1cvrR7FY has 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 the wrap/... identifier. For example, the URI wrap://ens/domain.eth:foo maps to domain.eth's wrap/foo text record. The wrap/foo text-record's value must contain another valid WRAP URI. For examples, see dev.polywrap.eth.
  • PR-1236 Plugin Refactor
    • Added addRedirects, addWrappers, addPackages methods to the ClientConfigBuilder, so users can add many items at once.
    • Added buildDefault to the ClientConfigBuilder which builds a ClientConfig using default resolvers.

@polywrap/plugin-js:

  • PR-1614 Add env To PluginModule Invocation Method Arguments
    • PluginModule invocation methods will now be given an env the method's arguments.
  • PR-1236 Plugin Refactor
    • New package for js plugins.
    • Can create plugin packages with PluginPackage.from.
      • Accepts manifest and a PluginModule, or an inline PluginModule.

@polywrap/uri-resolvers-js:

  • PR-1646 Resolution Result Cache Resolver
    • Added a new cache resolver ResolutionResultCacheResolver.
    • Unlike the 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).
    • By default, it does not cache errors, but a flag can be passed to enable that functionality.
  • PR-1528 Request Synchronizer Resolver
    • With URI resolvers, multiple requests for the same URI, in most cases, needlessly repeat the same process (usually a network request). Using a cache resolver (like PackageToWrapperCacheResolver) helps if the resolution requests are synchronous (one after another). This new RequestSynchronizerResolver can 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.
  • PR-1236 Plugin Refactor
    • Added StaticResolver and StaticResolver.from to optimize building resolvers with IUriRedirect, IUriWrapper and IUriPackage.

@polywrap/uri-resolver-extensions-js:

  • PR-1582 Update Default URI-Resolver-Ext Interface URI
    • The ExtendableUriResolver has been updated to get uri-resolver-ext implementations from the following interface URIs:

@polywrap/core-js:

  • PR-1431 WRAP Error Structure
    • Created a custom WrapError structure that improves debugging ability for common client error scenarios.
  • PR-1369 Remove Legacy Redirects
    • GetImplementationsOptions now accepts an optional resolution context, to be used to handle infinite recursion when a resolver uses getImplementations
    • GetImplementationsOptions now accepts an optional applyResolution. This can be used to apply URI resolution to interfaces.

@polywrap/logging-js:

  • PR-1379 Create @polywrap/logging-js Package
    • Created the @polywrap/logging-js package from the logging lib previously in the CLI's codebase.

JS Plugins

@polywrap/http-plugin-js:

  • PR-1471 Add form-data Support
    • Added form-data support through the inclusion of the formData: [FormDataEntry!] property on the Request object.

Breaking Changes

Toolchain

polywrap CLI:

  • PR-1561 Remove buildx builder by default
    • Added new keepBuilder option which is default to false and removed the previous removeBuilder option from the build manifest.
  • PR-1525 Unify Typescript App Templates
    • Remove typescript-node & typescript-react app templates, and replace them with a single typescript.
  • PR-1432 Remove Legacy Polywrap Project Metadata
    • Remove the polywrap.meta.yaml manifest.
  • PR-1367 Client Configuration Refactor
    • The JS/TS module passed into the --client-config option has a new function entrypoint signature. Instead of exporting a getCustomConfig function, users should export the following: configure(builder: IClientConfigBuilder): IClientConfigBuilder.
    • See example config.ts.
  • PR-1348 Rename run to test
    • Rename the run command to test, which uses the test project extension, as defined in the polywrap.test.yaml manifest file.
  • PR-1545 **Remove config section from test manifest
    • The Polywrap Test manifest (polywrap.test.yaml) has been upgraded to version 0.2.0 with the following change:
      • The config section inside step has been removed, and manifest migrations will warn the user regarding this change.

@polywrap/schema-bind

  • PR-1464 wasm/rust Bindings Now Use ModuleTrait Trait
    • Rust-based wraps no longer pub functions, but instead pub a impl ModuleTrait for Module.
  • PR-1460 wasm/assemblyscript Bindings Now Use ModuleBase Interface
    • AssemblyScript-based wraps no longer export functions, but instead export a class Module which extends ModuleBase.

@polywrap/test-env-js

  • PR-1530 Deprecate Legacy Test-Env Package
    • The test-env-js package has been deprecated, in favor of @polywrap/cli-js

JS Client

@polywrap/client-js:

  • PR-1534 Remove legacy config types from PolywrapClient
    • The PolywrapClient now simply accepts a CoreClientConfig, which is expected to come from the config builder.
  • PR-1461 Remove Legacy Invocation Methods
    • Remove client.query(...) & client.subscribe(...) methods.
  • PR-1369 Remove Legacy Redirects
    • PolywrapClient config when using noDefaults: true no longer accepts redirects (Since redirects have been removed from CoreClientConfig).
  • PR-1236 Plugin Refactor
    • The Polywrap Client with noDefaults: false no longer accepts a plugins field, but it accepts wrappers and packages.
      • resolver field has been replaced with resolvers, since with default client the resolver used is the RecursiveResolver with the PackageToWrapperCacheResolver.
    • The Polywrap Client with noDefaults: true, no longer accepts a plugins field. It is expected that devs using this option will manually configure their own resolver.
    • removed getPlugins and getPluginByUri. Will add getWrapper, getWrapperByUri, getPackage, getPackageByUri, in a follow up PR.
    • createPolywrapClient function has been deprecated.
  • PR-1534 Remove legacy config types from PolywrapClient
    • The PolywrapClient's constructor now accepts only an optional CoreClientConfig type as its configuration object.
    • It is now advised to use the ClientConfigBuilder found in @polywrap/client-config-builder-js and exported by @polywrap/client-js in order to set up their client configurations.

@polywrap/client-config-builder-js:

  • PR-1480 ClientConfigBuilder-specific BuilderConfig Object
    • The ClientConfigBuilder now uses a specific BuilderConfig that is easier for users to work with. It will then be turned into a CoreClientConfig through the use of the build() method.
  • PR-1498 Refactor ClientConfigBuilder.build()
    • Rename buildCoreConfig() to build(), which returns a CoreClientConfig instance.
  • PR-1494 Deprecate Legacy HTTP URIs in Default Config Bundle
    • The wrap://ens/http.polywrap.eth interface and wrapper have been removed from the default configuration bundle.
  • PR-1436 Deprecate Legacy Logger URIs in Default Config Bundle
    • The wrap://ens/logger.core.polywrap.eth interface and the wrap://ens/js-logger.polywrap.eth plugin wrapper have both been removed from the default configuration bundle.
  • PR-1446 Deprecate Legacy Ethereum URI in Default Config Bundle
    • The wrap://ens/ethereum.polywrap.eth URI + wrap has been removed from the default configuration bundle.
  • PR-1475 Deprecate Legacy IPFS URIs in Default Config Bundle
    • The wrap://ens/ipfs.polywrap.eth & wrap://ens/ipfs-resolver.polywrap.eth URIs + wraps have been removed from the default configuration bundle.
  • PR-1369 Remove Legacy Redirects
    • Calling buildCoreConfig no longer returns a CoreClientConfig with redirects since redirects are no longer a part of CoreClientConfig.
  • PR-1367 URI Redirect Renaming
    • Renamed removeUriRedirect(...) to removeRedirePR-15e pluginsand aresolver, but now has wrappers, packagesandresolvers`
    • Calling build returns an instance of the CustomClientConfig, which can be used with defaults from the PolywrapClient, but can not be used if noDefaults: true is passed to the PolywrapClient constructor.
    • Removed addPlugin from the ClientConfigBuilder, users can now use addWrapper or addPackage where appropriate.

@polywrap/plugin-js:

  • PR-1614 Remove env Property From PluginModule
    • PluginModule instances no longer have an env property, and instead will be given an env within the invocation method's arguments.

@polywrap/core-js:

  • PR-1613 Core Client Config Unique Maps
    • The CoreClientConfig now ReadonlyUriMaps for its interface and env properties.
  • PR-1369 Remove Legacy Redirects
    • redirects are no longer a part of CoreClientConfig.
    • getRedirects are no longer a part of CoreClient.
    • getUriResolver on CoreClient has been renamed to getResolver.
    • getImplementations returns a promise now.
    • GetImplementationsOptions no longer accepts applyRedirects. This has been replaces with applyResolution.
    • applyRedirects helper function has been replaced with applyResolution.
  • PR-1236 Plugin Refactor
    • Plugins are no longer a part of this package, they have been moved to the plugin-js package
    • Renamed UriRedirect to IUriRedirect to match IUriWrapper and IUriPackage
    • IUriRedirect, IUriWrapper and IUriPackage are now generic and their generic param implements Uri | string
    • Removed options argument from client.getManifest method since all wrappers have a deserialized manifest

@polywrap/uri-resolvers-js:

  • PR-1586 Separate the PackageToWrapperCacheResolver Into Two Resolvers
    • The PackageToWrapperCacheResolver has been split into the PackageToWrapperResolver & WrapperCacheResolver resolvers.
  • PR-1369 Remove Legacy Redirects
    • LegacyRedirectsResolver has been removed.
  • PR-1236 Plugin Refactor
    • Replaced helper func buildUriResolver with UriResolver.from
    • Constructors of built-in resolvers like RecursiveResolver and PackageToWrapperCacheResolver now accept a concrete IUriResolver while their static from methods accept a UriResolverLike
    • Remove PluginsResolver and PluginResolver, users can now use WrapperResolver or PackageResolver

@polywrap/uri-resolver-extensions-js:

  • PR-1582 Remove Legacy uri-resolver-ext Interface URI
    • The ExtendableUriResolver no longer supports the legacy interface URI wrap://ens/uri-resolver.core.polywrap.eth.

@polywrap/react:

  • PR-1236 Plugin Refactor
    • Replaced plugins on the PolywrapProvider with wrappers and packages

JS 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

polywrap CLI:

  • PR-1683 Don't Require Docker polywrap build On Interface Projects
    • When building type: interface projects, the CLI no longer requires docker to be running.
  • PR-1610 polywrap test Non-Zero Exit Codes
    • polywrap test now exits with an exit code of 1 if a test fails.
  • PR-1470 Fix Build Manifest Absolute Path Support
    • Accept absolute paths within the polywrap.build.yaml manifest's linked_packages property.
  • PR-1438 Support Maps In Workflows
    • Properly handle map types when running workflows using the test command.
  • PR-1396 Remove Wasm "Interface Types" Custom Section
    • The rust build images have been updated to properly remove the needless inclusion of the wasm-interface-types custom section, as a result of running wasm-bindgen. More information can be found here.
  • PR-1379 Manifest Upgrade Warning Message
    • Automatically upgrading manifests now emits a warning, suggesting users to upgrade their manifest.
  • PR-1382 Execute asc Using npx
    • Invoke asc using npx to help with program resolution.
  • PR-1368 Client Config Error Messaging
    • Update error messaging for the --client-config option.

@polywrap/schema-bind:

  • PR-1444 TypeScript Bindings Export Imports
    • The plugin/typescript and app/typescript bindings now properly export all interfaces.
  • PR-1443 Rust Bindings Use String
    • The wasm/rust bindings now use String instead of str within imported interface module typings.

JS Client

@polywrap/core-js:

  • PR-1593 Display decoded args when errors are thrown in subinvocations
    • Args used to be displayed as-is in error messages when errors were thrown in Wasm wrapper invocations. This meant args for subinvocations were byte arrays. Now the args are always decoded for errors so they are human-readable.
  • PR-1556 WrapError now correctly parses Rust unwrap errors
    • When calling .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:

  • PR-1487 Handle null URI Resolver Extension Return Results
    • Update the MaybeUriOrManifest & getFile interfaces to properly reflect the URI resolver extension interface.

Templates

@polywrap/templates:

  • PR-1383 Default Deploy Gateway
    • Add the https://ipfs.wrappers.io gateway to the interface template's polywrap.deploy.yaml manifest.