tailcall icon indicating copy to clipboard operation
tailcall copied to clipboard

feat: publish tailcall WASM build on NPM

Open tusharmath opened this issue 1 year ago • 11 comments

Publish tailcall on npm under

  • @tailcallhq/wasm-browser
  • @tailcallhq/wasm-node

Public API

import {GraphQLExecutor} from '@tailcallhq/tailcall'


// YML, JSON or GraphQL
const jsonConfig = " ... <tailcall config> ... "; 


// Use the builder to create the configuration
const builder = new TailcallBuilder().withJSONConfig(jsonConfig).withYMLConfig(ymlConfig);

// Build an instance of Tailcall, resolving configurations
const tailcall = await builder.build();


// Execute queries using the builder.
const query = "query {users {name}}"
await executor.execute({query})

Technical Requirements

  • I should be able to install the package via npm
  • I should be able to use the package in the browser directly
  • I should be able to use the package via node.js

tusharmath avatar Jan 26 '24 05:01 tusharmath

/bounty 300

tusharmath avatar Jan 26 '24 05:01 tusharmath

💎 $300 bounty • Tailcall Inc.

Steps to solve:

  1. Start working: Comment /attempt #1038 with your implementation plan
  2. Submit work: Create a pull request including /claim #1038 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

🙏 Thank you for contributing to tailcallhq/tailcall! 🧐 Checkout our guidelines before you get started. 💵 More about our bounty program.

Attempt Started (GMT+0) Solution
🟢 @ssddOnTop #1908

algora-pbc[bot] avatar Jan 26 '24 05:01 algora-pbc[bot]

can i get assigned to this , would love to work on this issue .

aabidsofi19 avatar Jan 26 '24 06:01 aabidsofi19

ayewo avatar Jan 26 '24 06:01 ayewo

Can you explain more about the package @tailcallhq/wasm-browser? It's confusing, according to my understanding, there should be just 1 package published i.e. @tailcallhq/wasm-nodewhich can be used in browser using nodejs. Or is it like we provide a js file (maybe via cdn) which can be used in browsers like

<!doctype html>
<html lang="en-US">
  <head>
    <meta charset="utf-8" />
    <title>hello-wasm example</title>
  </head>
  <body>
    <script type="module">
      import init, { GraphQLExecutor } from "path/to/tailcall.js";
      init().then(() => {
          const config = " ... <tailcall config> ... "; // YML, JSON or GraphQL
          const executor = new GraphQLExecutor(config);
          const query = "query {users {name}}"
          
          await executor.execute({query})
      });
    </script>
  </body>
</html>

ssddOnTop avatar Jan 27 '24 13:01 ssddOnTop

is anyone still working on this? if not, I would like to get assigned

gabrieldemian avatar Jan 31 '24 14:01 gabrieldemian

This GraphQLExecutor being exported, do you imagine it being a Rust source code compiled to WASM or being a JS layer that interfaces with the binary @tusharmath?

wesleymatosdev avatar Feb 14 '24 18:02 wesleymatosdev

Yes.

tusharmath avatar Feb 14 '24 18:02 tusharmath

@coderabbitai

webbdays avatar Mar 10 '24 04:03 webbdays

waiting for completion of #1153 or should I start without the builder API?

ssddOnTop avatar Mar 31 '24 16:03 ssddOnTop

💡 @ssddOnTop submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar May 09 '24 19:05 algora-pbc[bot]

Action required: Issue inactive for 30 days. Status update or closure in 7 days.

github-actions[bot] avatar Jun 10 '24 07:06 github-actions[bot]

Issue closed after 7 days of inactivity.

github-actions[bot] avatar Jun 17 '24 08:06 github-actions[bot]

💡 @ssddOnTop submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Jul 23 '24 05:07 algora-pbc[bot]

🎉🎈 @ssddOnTop has been awarded $300! 🎈🎊

algora-pbc[bot] avatar Jul 28 '24 09:07 algora-pbc[bot]

@tusharmath can we have tailcall check also in this?

webbdays avatar Jul 31 '24 01:07 webbdays

helpful to check if config is good in the browser.

webbdays avatar Jul 31 '24 01:07 webbdays