Open
Bug 880664
Opened 11 years ago
Updated 2 years ago
[Chrome Workers] Make module loader handle non-absolute paths
Categories
(Toolkit :: General, defect)
Toolkit
General
Tracking
()
NEW
People
(Reporter: Yoric, Unassigned)
References
Details
(Whiteboard: [Async:team])
Followup to bug 872421 > I still think you should not share require to allow relative require forms that are very common: > > `require("./foo/bar")`, require("../bar")` > > All you need is to capture `uri` and resolve to it. As a matter of fact I'd also encourage to implement > `require.main` which usually takes full `url` and all the modules then are resolved relative to it. > > Both devtools and jetpack code now supports `require("foo/bar")` that resolves to `resource://gre/modules/commonjs/foo/bar.js` > I think it maybe a good idea to support that too. Note that neither node or any other commonjs implementations I'm aware of > treat `foo/bar` equivalent to `./foo/bar` quite the contrary, usually `foo/bar` is equivalent to `/foo/bar` where `/` is root of your program.
Reporter | ||
Comment 2•11 years ago
|
||
Irakli, given that workers don't have a |document.uri|, how would you handle the "base uri"?
Reporter | ||
Updated•11 years ago
|
Flags: needinfo?(rFobic)
Comment 3•11 years ago
|
||
I would consider base URL to be an url of the script loaded into worker.
Flags: needinfo?(rFobic)
Reporter | ||
Comment 4•11 years ago
|
||
That's the problem, we don't know the url of the "main" script.
Reporter | ||
Comment 5•11 years ago
|
||
De-prioritizing until we have decided exactly what we want.
Whiteboard: [Async:P1] → [Async]
Updated•11 years ago
|
Whiteboard: [Async] → [Async:team]
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•