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: publish tailcall WASM build on NPM #1038

Open
Tracked by #1571
tusharmath opened this issue Jan 26, 2024 · 11 comments · May be fixed by #1908
Open
Tracked by #1571

feat: publish tailcall WASM build on NPM #1038

tusharmath opened this issue Jan 26, 2024 · 11 comments · May be fixed by #1908
Assignees

Comments

@tusharmath
Copy link
Contributor

tusharmath commented Jan 26, 2024

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
Copy link
Contributor Author

/bounty 300

Copy link

algora-pbc bot commented Jan 26, 2024

💎 $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

Additional opportunities:

🙏 Thank you for contributing to tailcallhq/tailcall!
🧐 Checkout our guidelines before you get started.

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

@tusharmath tusharmath changed the title publish tailcall WASM build on NPM feat: publish tailcall WASM build on NPM Jan 26, 2024
@aabidsofi19
Copy link

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

@ayewo
Copy link
Contributor

ayewo commented Jan 26, 2024

@ssddOnTop
Copy link
Member

ssddOnTop commented Jan 27, 2024

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>

@gabrieldemian
Copy link

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

@ologbonowiwi
Copy link
Contributor

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?

@tusharmath
Copy link
Contributor Author

Yes.

@webbdays
Copy link
Contributor

@coderabbitai

@tusharmath tusharmath mentioned this issue Mar 28, 2024
34 tasks
@ssddOnTop
Copy link
Member

ssddOnTop commented Mar 31, 2024

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

@ssddOnTop ssddOnTop removed their assignment Apr 7, 2024
@ssddOnTop ssddOnTop self-assigned this Apr 16, 2024
@ssddOnTop ssddOnTop linked a pull request May 9, 2024 that will close this issue
3 tasks
Copy link

algora-pbc bot commented May 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants