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

Replace @dual-bundle/import-meta-resolve with import-meta-resolve #7556

Open
Tracked by #7396
ybiquitous opened this issue Mar 11, 2024 · 5 comments
Open
Tracked by #7396

Replace @dual-bundle/import-meta-resolve with import-meta-resolve #7556

ybiquitous opened this issue Mar 11, 2024 · 5 comments
Labels
status: agreed but held is agreed on but implementation is held
Milestone

Comments

@ybiquitous
Copy link
Member

In PR #7532, we introduced the @dual-bundle/import-meta-resolve package to support both ESM and CJS, which is a fork of import-meta-resolve that is pure ESM.

When we switch to pure ESM (maybe in the next major version), we can replace @dual-bundle/import-meta-resolve with import-meta-resolve.

See also the code below:

// TODO: use pure ESM `import-meta-resolve` package in next major version
import { resolve } from '@dual-bundle/import-meta-resolve';

Note

Node.js has provided the import.meta.resolve() API, and we would like to use the API instead of import-meta-resolve, but it is still experimental. In addition, the --experimental-import-meta-resolve flag is necessary to use the second argument parent (at the point of Node.js 21.7.1). So it may be difficult to switch import.meta.resolve() in the next major version.

@ybiquitous ybiquitous added type: refactor status: agreed but held is agreed on but implementation is held labels Mar 11, 2024
@ybiquitous ybiquitous mentioned this issue Mar 11, 2024
5 tasks
@Mouvedia Mouvedia added this to the future-major milestone Mar 11, 2024
@boris-petrov
Copy link

Upgrading to Node.js 22.0.0 and running Stylelint leads to (node:202332) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.. It comes from @dual-bundle/import-meta-resolve/lib/resolve.js:139:12. So replacing this package is important to also fix this (if the other one has already resolved that deprecation).

@JounQin
Copy link
Member

JounQin commented Apr 28, 2024

@boris-petrov I believe you're describing wooorm/import-meta-resolve#27, right?

@boris-petrov
Copy link

@JounQin yes. It's good there is an issue so hopefully it will be fixed at some point. :)

@ybiquitous
Copy link
Member Author

https://github.com/wooorm/import-meta-resolve/releases/tag/4.1.0 now resolved the deprecation warning.

@JounQin Could you merge the upstream change into @dual-bundle/import-meta-resolve, please?

@JounQin
Copy link
Member

JounQin commented May 9, 2024

@dual-bundle/import-meta-resolve@4.1.0 has been released.

cc @boris-petrov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: agreed but held is agreed on but implementation is held
Development

No branches or pull requests

5 participants