Support for `import(blobUrls)`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
What is the problem this feature will solve?
The same thing that vm.SourceTextModule(yourCodeString, { identifier, context }) does, but in a way compatible with other JS runtimes.
Useful for implementing extensions, for example.
What is the feature you are proposing to solve the problem?
Compatibilty with other JS runtimes when it comes to import() and blob URLs.
Example code:
code = 'console.log("hi")'
blob = new Blob([code], { type: 'text/javascript' })
url = URL.createObjectURL(blob)
import(url)
References:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import
- https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static
- https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/blob
What alternatives have you considered?
vm.SourceTextModule(yourCodeString, { identifier, context })
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed import(url) example and compare it with vm.SourceTextModule(yourCodeString, { identifier, context }). Review the referenced import(), URL.createObjectURL(), and blob URL behavior to define the compatibility target. Done means the example works with a Blob-created JavaScript URL in Node.js and matches the relevant runtime behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100