Skip to content
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

Feat: Post origin build artifact #1046

Merged
merged 70 commits into from
Aug 18, 2022
Merged

Conversation

cbrzn
Copy link
Contributor

@cbrzn cbrzn commented Jul 13, 2022

Warning: This PR is being blocked by #1073

Post origin build artifact

Objective

Removal of schema.graphql in wrappers (wasm, plugins) & interfaces built artifact

Breaking changes

This introduces breaking changes that makes old wrappers not compatible with the new ones built with this new artifact. The reason is that currently, when a wrapper is imported, it tries to resolve a schema.graphql which is a string that needs to be converted to ABI.

  • Plugins will have wrap.info (encoded w/msgpack) inside of build folder and wrap.info.ts inside of the wrap folder. Also, the getManifest method will be implemented in PluginWrapper, allowing us to access to this manifest

  • Polywrap (WASM & Interface), plugins, and app manifest have been updated to version 2.0, being the main change in the attribute import_redirects, in order to support info instead of schema, allowing developers to point to wrap.info insteaf of the schema.graphql

  • Previously, we had the type PluginPackageManifest for plugins manifests

    /** The plugin package's manifest */
    export interface PluginPackageManifest {
      /** The Wrapper's schema */
      schema: string;
    
      /** All interface schemas implemented by this plugin. */
      implements: Uri[];
    }
    
    export type PluginPackage<TConfig> = {
      factory: () => PluginModule<TConfig>;
      manifest: PluginPackageManifest;
    };
    

    This has been changed to:

    export type PluginPackage<TConfig> = {
      factory: () => PluginModule<TConfig>;
      manifest: WrapManifest;
    };
    

Other important changes

  • schema.ts has been removed from app codegen
  • schema/composer package doesn't output the schema anymore, but instead, only the ABI

Hotfixes

Because of the circular dependency in our monorepo, a few hacks needed to be done in order to have a functional build process of the libraries:

  • Create wrap-man with new structure inside of every plugin and update the files to point to this manually generated folder
  • Create build-man for interfaces so they have the wrap.info file

hack.md of this description: https://hackmd.io/@cbrzn/Bki01E32q

dOrgJelli and others added 30 commits July 5, 2022 16:44
@dOrgJelli dOrgJelli merged commit 60c35e8 into origin-dev Aug 18, 2022
@dOrgJelli
Copy link
Contributor

wrap.info -> schema.graphql

@dOrgJelli dOrgJelli deleted the feat/remove-schema-file branch August 22, 2022 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants