Last Comment Bug 880664 - [Chrome Workers] Make module loader handle non-absolute paths
: [Chrome Workers] Make module loader handle non-absolute paths
Status: NEW
Product: Toolkit
Classification: Components
Component: General (show other bugs)
: unspecified
: All All
-- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: 880663 (view as bug list)
Depends on: 583083 679189 832609 872421 873020
Blocks: WorkForTheWorkers 880663
  Show dependency treegraph
Reported: 2013-06-07 05:37 PDT by David Teller [:Yoric] (please use "needinfo")
Modified: 2014-09-24 03:45 PDT (History)
16 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image David Teller [:Yoric] (please use "needinfo") 2013-06-07 05:37:05 PDT
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.
Comment 1 User image David Teller [:Yoric] (please use "needinfo") 2013-06-07 06:07:34 PDT
*** Bug 880663 has been marked as a duplicate of this bug. ***
Comment 2 User image David Teller [:Yoric] (please use "needinfo") 2013-06-07 07:07:42 PDT
Irakli, given that workers don't have a |document.uri|, how would you handle the "base uri"?
Comment 3 User image Irakli Gozalishvili [:irakli] [:gozala] [@gozala] 2013-06-17 13:50:48 PDT
I would consider base URL to be an url of the script loaded into worker.
Comment 4 User image David Teller [:Yoric] (please use "needinfo") 2013-06-17 22:19:06 PDT
That's the problem, we don't know the url of the "main" script.
Comment 5 User image David Teller [:Yoric] (please use "needinfo") 2013-10-10 06:32:55 PDT
De-prioritizing until we have decided exactly what we want.

Note You need to log in before you can comment on or make changes to this bug.