Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

import.meta.resolve support#14930

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SimenB merged 11 commits intojestjs:mainfromCheadleCheadle:resolve
Mar 3, 2024
Merged

Conversation

@CheadleCheadle
Copy link
Contributor

@CheadleCheadleCheadleCheadle commentedFeb 29, 2024
edited by SimenB
Loading

Summary

Fixes#14923

Jest and libraries support usingimport { createRequire } from 'node:module';
const require = createRequire(import.meta.url); to resolve relative paths.

This was a useful convention for a while, but now we haveimport.meta.resolve(…) to express a relative path resolution.

It is supported byall major browsers and all major runtimes.

import.meta.resolve Support: Jest now supports the import.meta.resolve function, allowing users to resolve module specifiers in a manner consistent with the standard JavaScript module system.

Test plan

Successfully resolves paths

Note: This is an initial, primitive implementation and currently supports basic resolution functionality. I am interested in what features such as support for dynamic string values should be incorporated.

foobar

foobarres

@netlify
Copy link

netlifybot commentedFeb 29, 2024
edited
Loading

Deploy Preview forjestjs ready!

NameLink
🔨 Latest commit8178a6a
🔍 Latest deploy loghttps://app.netlify.com/sites/jestjs/deploys/65e485113b035e0008470821
😎 Deploy Previewhttps://deploy-preview-14930--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site configuration.

Copy link
Member

@SimenBSimenB left a comment

Choose a reason for hiding this comment

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

Thanks! could you also add a changelog entry?

CheadleCheadle reacted with thumbs up emoji
Copy link
ContributorAuthor

@CheadleCheadleCheadleCheadle left a comment

Choose a reason for hiding this comment

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

looks good to me!

@SimenB
Copy link
Member

SimenB commentedMar 3, 2024
edited
Loading

From reading the docs, it seems

  1. it should actually be synchornous like you first had it - the types are wrong
  2. It should always return a file url (as a string)

I'll fix both 🙂

Copy link
Member

@SimenBSimenB left a comment

Choose a reason for hiding this comment

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

thanks!

CheadleCheadle reacted with laugh emojiCheadleCheadle reacted with hooray emoji
@SimenBSimenB merged commit442c7f6 intojestjs:mainMar 3, 2024
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend usingStackOverflow or ourdiscord channel for questions.

@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 4, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@SimenBSimenBSimenB approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Feature]: Supportimport.meta.resolve

2 participants

@CheadleCheadle@SimenB

[8]ページ先頭

©2009-2025 Movatter.jp