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

[feature] conditional compilation for SES compatibility #133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

veronicaz41
Copy link

@veronicaz41 veronicaz41 commented Mar 26, 2022

Add a new ses build ./build/main.ses.cjs
Conditional compilation, so this can be used in ffjavascript to conditional compile Worker related code.
See the ffjavascipt PR here: iden3/ffjavascript#32

  • Need to update circom_runtime, r1csfile and binfileutils fo ffjavascript dependency

@veronicaz41 veronicaz41 changed the title conditional compilation for SES compatibility [feature] conditional compilation for SES compatibility Mar 26, 2022
@veronicaz41
Copy link
Author

cc @phated FYI, this works for us

@veronicaz41 veronicaz41 marked this pull request as ready for review March 29, 2022 00:42
import replace from "@rollup/plugin-replace";

const pkg = JSON.parse(fs.readFileSync("./package.json"));
delete pkg.dependencies["ejs"];
Copy link
Author

Choose a reason for hiding this comment

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

have to remove ejs, because this line is not SES compatible: https://github.com/mde/ejs/blob/main/lib/ejs.js#L109

Copy link
Contributor

Choose a reason for hiding this comment

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

That shouldn't be how this works. These are marking the dependency as "external" so it isn't put into the bundle. When you delete it from this, it will actually be included.

Copy link
Author

Choose a reason for hiding this comment

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

this worked us because it removed the var ejs = require('ejs'); from main.ese.cjs.
and the metamask uses browserify to package all this.
but yeah, we should talk before you merge any of my PRs.

import replace from "@rollup/plugin-replace";

const pkg = JSON.parse(fs.readFileSync("./package.json"));
delete pkg.dependencies["ejs"];
Copy link
Author

Choose a reason for hiding this comment

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

have to remove ejs, because this line is not SES compatible: https://github.com/mde/ejs/blob/main/lib/ejs.js#L109

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

Successfully merging this pull request may close these issues.

2 participants