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

Port internal TS code to JS #6793

Merged
merged 56 commits into from
Jul 19, 2020
Merged

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Jul 18, 2020

This PR converts our internal runtime code to use pure JS instead of TS. It enables future refactors:

  • reducing the size of the compiler snapshot.
  • removing deno_typescript crate completely
  • op crates

This work has been planned extensively beforehand: See the design doc.

Incremental compile: from 2 min down to 30 seconds

touch cli/js/web/fetch.ts; cargo build

master           2m 06s
master           1m 55s

#6756               54s
#6756               51s

this branch         33s
this branch         31s

Release binary size: 1mb smaller

Due to removing source maps for internal code. (Measured on mac.)

master         48122324
this branch    47326308

Code size: ~2700 fewer lines of code

In particular, removes our compile-time TypeScript compiler. This reduces the number of custom TypeScript compilers from 2 to 1.

 214 files changed, 16804 insertions(+), 19549 deletions(-)

cli/build.rs Outdated Show resolved Hide resolved
cli/build.rs Outdated Show resolved Hide resolved
@ry
Copy link
Member

ry commented Jul 19, 2020

Happy to add TSDoc - I agree that gets us 90% of the way there. I'm not going to request that Bartek do that in this PR tho.

@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Jul 19, 2020

  • It turns out code related to web APIs is dependent on the
    Deno.build - mostly for deciding on line endings (eg. URL).

Fixed in #6807 (for URL). I'll end up copy-paste merging it over this PR.

@ry ry mentioned this pull request Jul 19, 2020
6 tasks
@ry ry changed the title Simplify by porting internal TS code to JS Port internal TS code to JS Jul 19, 2020
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit fa61956 into denoland:master Jul 19, 2020
@bartlomieju bartlomieju deleted the delete-ts4 branch July 19, 2020 17:50
@towertop
Copy link

The markdown cli/js/web/README.md was removed. It worked well for looking up the state of Web API implementation. Doesn't it apply for new js2 version?

@ry
Copy link
Member

ry commented Jul 22, 2020

@towertop Thanks for the notice - I've added it back in #6842

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.

6 participants