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

TypeScript and ES6+ support using esbuild. #3738

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

Conversation

szkiba
Copy link
Contributor

@szkiba szkiba commented May 13, 2024

What?

With the introduction of the "enhanced" compatibility mode, the test source code is transformed using esbuild instead of Babel.

Why?

Source files with the extension ".ts" are loaded by esbuild's TypeScript loader, which results in partial TypeScript support. This esbuild removes exactly the type information, but does not provide type safety.

Source files other than ".ts" are loaded by esbuild's JavaScript loader, which results in the support of a more modern JavaScript dialect than goja.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

#3703

Closes #3703

With the introduction of the "enhanced" compatibility mode, the test source code is transformed
using esbuild instead of Babel.

Source files with the extension ".ts" are loaded by esbuild's TypeScript loader, which results in partial
TypeScript support. This esbuild removes exactly the type information, but does not provide type safety.

Source files other than ".ts" are loaded by esbuild's JavaScript loader, which results in the support of a
more modern JavaScript dialect than goja.
…rors.

Running the tc39 tests also in "enhanced" (esbuild) compatibility mode.
Previously, the test wrote the JSON format file to be saved to the standard output,
which had to be manually cleaned from the other test output.
This solution is difficult to apply in the case of one or more compatibility modes,
so it has been changed to the usual golden file pattern.

The reference breaking_test_errors-extended.json and breaking_test_errors-enhanced.json
files can be updated using the go test -update command.
@szkiba szkiba linked an issue May 13, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.89%. Comparing base (33d3caa) to head (24bc381).

❗ Current head 24bc381 differs from pull request most recent head e760a20. Consider uploading reports for the commit e760a20 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3738      +/-   ##
==========================================
+ Coverage   70.83%   70.89%   +0.06%     
==========================================
  Files         289      290       +1     
  Lines       21159    21194      +35     
==========================================
+ Hits        14988    15026      +38     
+ Misses       5214     5211       -3     
  Partials      957      957              
Flag Coverage Δ
ubuntu 70.82% <100.00%> (+0.07%) ⬆️
windows 70.75% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@szkiba szkiba marked this pull request as ready for review May 14, 2024 07:36
@szkiba szkiba requested a review from a team as a code owner May 14, 2024 07:36
@szkiba szkiba requested review from codebien and olegbespalov and removed request for a team May 14, 2024 07:36
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.

Native TypeScript support
2 participants