graphprotocol / mutations

Apache License 2.0
4 stars 5 forks source link

Investigate Node & Web Bundle Support #14

Open dOrgJelli opened 4 years ago

dOrgJelli commented 4 years ago

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:

More discussion around this issue can be found here: https://github.com/graphprotocol/rfcs/pull/10#discussion_r370540802

dOrgJelli commented 4 years ago

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.