This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new context functions, fix issue when resolveId returns an object (…
…#387) * Update dependencies * Transform to new plugin hooks * Use Sets, remove a micro task * Make transform hook sync * Switch to using a Map again * Refine CJS Promise handling * Switch from buble to babel, add Node 6 and 12 tests * Get rid of Node12 for now until we figured out how to rewrite tests with globals * Use external "is-reference" * Change format of proxy ids to `\0file/path?commonjs-proxy` * Update dependencies * fix tests * Remove Node 6 again from tests
- Loading branch information
1 parent
851ed8e
commit c8fabd7
Showing
23 changed files
with
1,615 additions
and
539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
const isCjsPromises = Object.create(null); | ||
const isCjsPromises = new Map(); | ||
|
||
export function getIsCjsPromise(id) { | ||
let isCjsPromise = isCjsPromises[id]; | ||
let isCjsPromise = isCjsPromises.get(id); | ||
if (isCjsPromise) return isCjsPromise.promise; | ||
|
||
const promise = new Promise(resolve => { | ||
isCjsPromises[id] = isCjsPromise = { | ||
isCjsPromise = { | ||
resolve, | ||
promise: undefined | ||
}; | ||
isCjsPromises.set(id, isCjsPromise); | ||
}); | ||
isCjsPromise.promise = promise; | ||
|
||
return promise; | ||
} | ||
|
||
export function setIsCjsPromise(id, promise) { | ||
const isCjsPromise = isCjsPromises[id]; | ||
export function setIsCjsPromise(id, resolution) { | ||
const isCjsPromise = isCjsPromises.get(id); | ||
if (isCjsPromise) { | ||
if (isCjsPromise.resolve) { | ||
isCjsPromise.resolve(promise); | ||
isCjsPromise.resolve(resolution); | ||
isCjsPromise.resolve = undefined; | ||
} | ||
} else { | ||
isCjsPromises[id] = { promise, resolve: undefined }; | ||
isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: undefined }); | ||
} | ||
} |
Oops, something went wrong.
c8fabd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there! Any information you can provide on how to move to v10? Since this was already published we got some notification about the update but unsure how to move to this new major version. Thanks!
c8fabd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forgot to push the updated changelog and release tag. Should be fixed now!