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

Warn on mixing ESM and commonJS #3807

Merged
merged 5 commits into from
Jun 25, 2024
Merged

Warn on mixing ESM and commonJS #3807

merged 5 commits into from
Jun 25, 2024

Conversation

mstoykov
Copy link
Contributor

What?

As part of testing for #3265 it was noticed this isn't uncommon.

Why?

As there is no way for this to be supported and it will be against how the specification works we prefer to warn users on this at least for a little while.

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)

As part of testing for #3265 it was noticed this isn't uncommon.

As there is no way for this to be supported and it will be against how
the specification works we prefer to warn users on this at least for a
little while.
@mstoykov mstoykov added this to the v0.52.0 milestone Jun 24, 2024
@mstoykov mstoykov requested a review from a team as a code owner June 24, 2024 08:15
@mstoykov mstoykov requested review from oleiade and joanlopez and removed request for a team June 24, 2024 08:15
oleiade
oleiade previously approved these changes Jun 24, 2024
js/compiler/compiler.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@8efec40). Learn more about missing BASE report.

Current head d42b93f differs from pull request most recent head e7dc8e1

Please upload reports for the commit e7dc8e1 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3807   +/-   ##
=========================================
  Coverage          ?   71.87%           
=========================================
  Files             ?      291           
  Lines             ?    21274           
  Branches          ?        0           
=========================================
  Hits              ?    15290           
  Misses            ?     4920           
  Partials          ?     1064           
Flag Coverage Δ
ubuntu 71.80% <100.00%> (?)
windows 71.74% <100.00%> (?)

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.

mstoykov and others added 3 commits June 24, 2024 11:33
Co-authored-by: Théo Crevon <oleiade@users.noreply.github.com>
@codebien codebien self-requested a review June 24, 2024 08:37
js/compiler/compiler.go Show resolved Hide resolved
js/compiler/compiler.go Outdated Show resolved Hide resolved
Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com>
@mstoykov mstoykov requested a review from oleiade June 24, 2024 09:43
@mstoykov mstoykov merged commit a525231 into master Jun 25, 2024
23 checks passed
@mstoykov mstoykov deleted the k6-modulesMixupWarning branch June 25, 2024 07:05
mstoykov added a commit to mstoykov/postman-to-k6 that referenced this pull request Jun 27, 2024
It seems that at some point when this was written someone mixed ESM and
CommonJS syntax.

There is not good reason to do this, and it will soon not be supported -
and arguably has never been, it just happened to work due to how ESM was
supported in k6.

See grafana/k6#3807 and linked issues/PRs
thim81 pushed a commit to apideck-libraries/postman-to-k6 that referenced this pull request Jun 27, 2024
It seems that at some point when this was written someone mixed ESM and
CommonJS syntax.

There is not good reason to do this, and it will soon not be supported -
and arguably has never been, it just happened to work due to how ESM was
supported in k6.

See grafana/k6#3807 and linked issues/PRs
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.

5 participants