Code Monkey home page Code Monkey logo

dev-bb.js's Introduction

Important

Please note: You're not currently in the BB.js repository.

If you wish to use BB.js, there are two recommended methods:

  1. Use the published package available on npm.
  2. Build from the main Barretenberg repository, which is available here.

Ensure to choose the method that best suits your project's needs.

dev-bb.js's People

Contributors

jonybur avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

defynow

dev-bb.js's Issues

Cross-Origin-Embedder-Policy/Cross-Origin-Opener-Policy headers

Right now the NextJS application requires headers to be set:

Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin

This is to allow for multithreading to work. Otherwise we get this error:

Uncaught (in promise) Error: Failed to execute 'postMessage' on 'Worker': SharedArrayBuffer transfer requires self.crossOriginIsolated.

This is due to a security policy change in modern browsers. SharedArrayBuffers were disabled in most browsers because they could be used in a type of attack called a Spectre attack. SharedArrayBuffer and high-resolution timers could be used in combination to read memory across origins, which is a serious security issue.

However, SharedArrayBuffers were re-enabled on pages that are cross-origin isolated. Cross-origin isolation is a state a website can be in where it can safely use powerful features like SharedArrayBuffer.

Worker's circular dependency when building for NextJS

Right now the NextJS requires that the config has an esmExternals: "loose" flag set up, so that it allows for the new Worker(new URL("../../barretenberg.js", import.meta.url)).

The alternative to this, is importing the worker script by using worker-loader, but it hangs on build due to the circular nature of the import.

The esmExternals: "loose" flag could be removed from NextJS by refactoring barretenberg and removing the circular dependency, and then adding worker-loader to the webpack config - or by finding a different way of loading the script.

Minification disabled for production

Right now the NextJS app requires for minification to be disabled in the prod version of the build. This is likely not needed, and it could be because of webpack not resolving the worker script path correctly.

This can probably be fixed by fixing how webpack handles the minification of the worker script.

Update README: Add WIP warning & link to source code

To minimize confusions:

  • A "Working In Progress" warning should be added to the README until build and release infrastructures are in place and the builds hosted in this repo are ready for consumption
  • The source code of where the builds are compiled from should be linked to in the README

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.