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

Support loading ECMAScript modules, but drop sync API (#230) #234

Merged
merged 1 commit into from
May 23, 2022

Conversation

michael42
Copy link
Contributor

@michael42 michael42 commented Mar 29, 2022

Notable Changes

This PR implements support for .mjs config files (and .js config files within "type": "modules" projects). To support that without much hassle, support for synchronously loading configs is dropped, as ECMAScript Modules are loaded inherently async.

Commit Message Summary (CHANGELOG)

commit message body...

Type

  • CI
  • Fix
  • Perf
  • Docs
  • Test
  • Chore
  • Style
  • Build
  • Feature
  • Refactor

SemVer

  • Fix (:label: Patch)
  • Feature (:label: Minor)
  • Breaking Change (:label: Major)

Issues

  • Fixes #230

Checklist

  • Lint and unit tests pass with my changes
  • I have added tests that prove my fix is effective/works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes are merged and published in downstream modules

src/index.js Outdated
}
}

// prefers import, which won't work in sync mode
Copy link
Member

Choose a reason for hiding this comment

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

Will it better to check Node.js version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think feature detection is a bit cleaner, as it might support different runtimes (like Deno). Although in this case, the feature-detection is quite Node-specific and I don't find documentation for it in the Node 10 docs.

@michael42 michael42 marked this pull request as ready for review April 6, 2022 19:52
@michael42 michael42 changed the title Try out support for ECMAScript modules (#230) Support loading ECMAScript modules, but drop sync API (#230) Apr 6, 2022
@ai
Copy link
Member

ai commented Apr 10, 2022

I will put this task on a little hold until Node.js 12 EOL

@binyamin
Copy link

binyamin commented May 4, 2022

I will put this task on a little hold until Node.js 12 EOL

@ai That time has come. See the release chart.

@ai
Copy link
Member

ai commented May 23, 2022

Released in 4.0

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.

3 participants