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

Native ESM support #3456

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

Native ESM support #3456

wants to merge 2 commits into from

Conversation

mstoykov
Copy link
Collaborator

What?

Native support for ESM in k6

Why?

Having native ESM support both allows us to use more goja features and drops our internal babel.

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)

Closes #3265

@mstoykov mstoykov mentioned this pull request Nov 15, 2023
4 tasks
@mstoykov mstoykov changed the title Esm Native ESM support Nov 15, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

Attention: Patch coverage is 79.41176% with 63 lines in your changes are missing coverage. Please review.

Project coverage is 73.58%. Comparing base (3a7bf2c) to head (ab63cf5).
Report is 2 commits behind head on master.

❗ Current head ab63cf5 differs from pull request most recent head 27973ce. Consider uploading reports for the commit 27973ce to get more accurate results

Files Patch % Lines
js/modules/require_impl.go 61.29% 27 Missing and 9 partials ⚠️
js/modules/cjsmodule.go 80.48% 7 Missing and 1 partial ⚠️
js/modules/resolution.go 84.61% 5 Missing and 3 partials ⚠️
js/modules/gomodule_basic.go 75.00% 3 Missing and 2 partials ⚠️
js/modules/gomodule.go 91.17% 3 Missing ⚠️
js/bundle.go 92.00% 1 Missing and 1 partial ⚠️
js/compiler/compiler.go 96.15% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3456      +/-   ##
==========================================
+ Coverage   73.57%   73.58%   +0.01%     
==========================================
  Files         277      276       -1     
  Lines       20234    20322      +88     
==========================================
+ Hits        14887    14954      +67     
- Misses       4399     4414      +15     
- Partials      948      954       +6     
Flag Coverage Δ
ubuntu 73.58% <79.41%> (+0.08%) ⬆️
windows ?

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.

This is still very hackish and tries to preserve every observable
behavior possible.

This also specifically skips adding support for:
1. dynamic import
2. top level await
3. anything around the internal go modules

Which will be added later. Also let us concentrate on making this change
as not breaking as possible.
@codebien codebien removed the request for review from a team March 19, 2024 10:41
@mstoykov mstoykov modified the milestones: v0.51.0, v0.52.0 Apr 25, 2024
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 ESM support
2 participants