Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Upgrade primary build target to ES2017, add browser build #28

Merged
merged 3 commits into from
May 28, 2020

Conversation

ryanio
Copy link
Contributor

@ryanio ryanio commented May 20, 2020

This PR is a breaking change and upgrades the primary typescript build target to ES2017 and adds a ES5 browser build as inspired by ethereumjs/merkle-patricia-tree#117 and ethereumjs/ethereumjs-monorepo#603.

See the readme on how to dependent libraries should update their usage.

@@ -1,3 +1,3 @@
#!/bin/sh
set -o xtrace
exec tsc -p ./tsconfig.prod.json
tsc -p ./tsconfig.prod.json && test -f ./tsconfig.browser.json && tsc -p ./tsconfig.browser.json
Copy link
Contributor

@evertonfraga evertonfraga May 21, 2020

Choose a reason for hiding this comment

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

I think we should keep the execs there. Reference: #13 (review)

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the idea to silently fail when there's no browser config? If so, 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

re: exec I was having issues with it, I will dig deeper for its purpose, thanks for the link

Copy link
Member

Choose a reason for hiding this comment

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

Removing the exec is right, as it means "replace the bash process with this other one". So the script will stop after tsc executes, even if it's successful. For example, this never prints Hi:

exec true
echo "Hi"

What I'd do is set -e at the beginning of the script. That makes the bash process fail if any of the commands fail.

@evertonfraga
Copy link
Contributor

@ryanio I pushed the suggested changes. Can you take another look, please?

@ryanio
Copy link
Contributor Author

ryanio commented May 22, 2020

@evertonfraga thanks for that, looks great, just tested and seems to work as expected 👍

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Yeah, looks good, thanks Everton!

@ryanio ryanio merged commit 0f2c6d8 into master May 28, 2020
@alcuadrado
Copy link
Member

Does this mean that when VM v5 gets released it will be compiled with two targets? :) And it will include MPTv4 also with two targets?

@ryanio
Copy link
Contributor Author

ryanio commented May 28, 2020

Yes! We already integrated it separately in MPT but it inspired this PR, so once this release gets published anyone who installs @ethereumjs/config-typescript can support a browser build by adding a tsconfig.browser.json and running ethereumjs-config-ts-build (detailed in readme) 😊

@alcuadrado
Copy link
Member

that's awesome!

@holgerd77
Copy link
Member

What is the current state of this? This needs a release I would assume and a PR on an integration in the monorepo regarding to ethereumjs/ethereumjs-monorepo#821?

Is this relatively straight-forward or are there any blockers along the way? Any help needed in any regard?

@holgerd77
Copy link
Member

What is the state with the releases here? Can we move forward with this and integrate into the consuming libraries?

@ryanio
Copy link
Contributor Author

ryanio commented Sep 15, 2020

@evertonfraga was making progress on integrating this and other ethereumjs-config@v2 changes into the monorepo, maybe he can give an update on where he is with that. i'm happy to help with any remaining work.

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

Successfully merging this pull request may close these issues.

4 participants