这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Angelmmiguel
Copy link
Contributor

This PR is built on top of #168. We will need to merge and rebase this branch before

The goal of this PR is to introduce more methods and common APIs to the JavaScript kit. It introduces the following APIs:

  • fetch
  • console
  • URLSearchParams
  • TextEncoder and TextDecoder
  • A more complete Response implementation
  • Better error management

It refs #165

Building the shim

Before, the shim was a single glue.js file. All JavaScript code was hardcoded as we were not using any bundling system. To start using external libraries, I added esbuild, a fast bundler for JavaScript. The shim code is available in the kits/javascript/shims folder and it contains all the files and references different external libraries.

As part of the build process of the JS engine, it builds the shim and injects it in the final Wasm module.

External libraries

To avoid re-implementing all these APIs manually, we are using existing libraries:

@Angelmmiguel Angelmmiguel added the 🚀 enhancement New feature or request label Jul 4, 2023
@Angelmmiguel Angelmmiguel added this to the v1.4.0 milestone Jul 4, 2023
@Angelmmiguel Angelmmiguel requested a review from a team July 4, 2023 11:52
@Angelmmiguel Angelmmiguel self-assigned this Jul 4, 2023
@Angelmmiguel Angelmmiguel force-pushed the 165-add-fetch-to-js-kit branch 3 times, most recently from 68f91f0 to 0d501eb Compare July 4, 2023 14:57
Copy link
Contributor

@ereslibre ereslibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! A couple minor comments.

@Angelmmiguel Angelmmiguel force-pushed the 165-add-fetch-to-js-kit branch from c51311f to 5023752 Compare July 6, 2023 07:02
@Angelmmiguel Angelmmiguel changed the base branch from 165-add-http-bindings to main July 6, 2023 07:02
@Angelmmiguel Angelmmiguel merged commit bcbf473 into main Jul 6, 2023
@Angelmmiguel Angelmmiguel deleted the 165-add-fetch-to-js-kit branch July 6, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants