Skip to content

Investigate Node & Web Bundle Support #14

Open

Description

@dOrgJelli

We have not seen success bundling an ES5 monolithic module that works for both Node & Web. We've tried this using Webpack & Babel. You can find the project we tried this in here: https://github.com/dOrgTech/the-graph-mutations-spec/tree/master/example/subgraph/src/mutations

In order to test this, I'd suggest creating a simple test project that has 3 folders:

  • bundle - simple Typescript project that includes some commonly used packages like ipfs-https-client & ethers.js.
  • node-app - simple node app that includes bundle's built module.
  • web-app - simple web app that includes bundle's built module.

More discussion around this issue can be found here: graphprotocol/rfcs#10 (comment)

Activity

  1. dOrgJelli commented on Mar 3, 2020

    @dOrgJelli
    ContributorAuthor

    The reason for this being necessary is that graph-cli is a node application, and dApps are browser based applications. graph-cli imports the mutations module to verify it exports things properly.

    This means that by default the mutations module must be usable in both browser & node target environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions