Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Finish refactor of web build #33

Merged
merged 9 commits into from
Nov 29, 2021
Merged

Finish refactor of web build #33

merged 9 commits into from
Nov 29, 2021

Conversation

mitschabaude
Copy link
Contributor

This is a follow-up of #23 which removes some problems that remained in the web build:

  • We no longer maintain a manually-rewritten version of plonk_wasm.js, instead the original file is rewritten automatically during the build.
  • We no longer need worker's src to be fetched from Github, instead now everything is created from a single bundle.
  • That bundle no longer contains duplicates of code portions like the wasm bytecode.

The old strategy, which lead to duplicated code, was to include the source of our workers in the bundle as a string. The new strategy is to wrap all modules that are needed in a worker in functions. When starting a worker, we first dynamically create its source code by calling Function.toString() on the functions that make up the worker's code, and concatenate those. We also have a system for declaring dependencies of a function so that we can recursively find all the functions that need to be in the worker's code.

Copy link
Contributor

@MartinMinkov MartinMinkov left a comment

Choose a reason for hiding this comment

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

LGTM!

@mitschabaude mitschabaude merged commit 01870d7 into main Nov 29, 2021
@mitschabaude mitschabaude deleted the feature/better-web-build branch November 29, 2021 21:44
gabrielbosio pushed a commit to lambdaclass/o1js that referenced this pull request Nov 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants