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

Transform with Babel in advance of JerryScript ES2015 partial support #172

Open
SergioMorchon opened this issue Dec 21, 2019 · 1 comment

Comments

@SergioMorchon
Copy link
Contributor

SergioMorchon commented Dec 21, 2019

  1. Actually, we are transpiling and generating helpers with TypeScript.
  2. Nowdays, the state of the art is to split linting, type checking, transpilation and bundling into different tools/steps. Here we are mixing type-checking and transpilation.
    1.1. This is important because the used JS engine, jerryscript, supports not just full ECMAScript 5.1, but also some interesting features of ES2015 (you can se them listed in the release notes).

By using Babel to transform the code, we can customize which transformations we want, and skip the ones that JerryScript 2.1 already handles natively.

JerryScript support of ES2015 features

Use Babel + JerryScript following https://github.com/jerryscript-project/jerryscript/tree/v2.1.0/tools/babel

@SergioMorchon SergioMorchon changed the title Transform with Babel Transform with Babel in advance of JerryScript ES2015 partial support Dec 21, 2019
@Hexxeh
Copy link
Contributor

Hexxeh commented Feb 18, 2020

So to do this, we'd want to change our toolchain such that TypeScript is acting only as a typechecker. We'd then want to enable the plugins in Babel such that it can not choke on TypeScript code as an input, and do all the transpilation.

Once that's done and we're copying what's currently happening, we could start turning off Babel plugins one by one as we determine they're not needed based on the JerryScript features we have on device in order to reduce code size by avoiding transpiling features that are actually supported on device.

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

No branches or pull requests

2 participants