Community
Participate
Working Groups
Is there any reason we haven't upgraded Orion's requirejs library to 2.x yet? We are currently at 1.0.7.
Well to answer my own question... I tested 2.1.5 locally to take advantage of some new features. So far I found one issue, it seems the behavior of require.toUrl() has changed in a way that breaks the banner nav links. This code in /orion/PageLinks.js: In 1.0.7 > require.toUrl(".") // "../orion" > new URL(require.toUrl("."), window.location).href.slice(0,-1); // "http://localhost:8080/orio" In 2.1.5: > require.toUrl(".") // "../." > new URL(require.toUrl("."), window.location).href.slice(0,-1); // "http://localhost:8080/"
Those labels got reversed. I meant to say: In 1.0.7: > require.toUrl(".") // ../. > new URL(require.toUrl("."), window.location).href.slice(0,-1); // http://localhost:8080 In 2.1.5: > require.toUrl(".") // ../orion > new URL(require.toUrl("."), window.location).href.slice(0,-1); // http://localhost:8080/orio
(In reply to comment #2) It sounds like toUrl(".") may've been a misuse of this API. It now claims to only work on "[module path] + .fileextension" [1][2]. I did find that we can call toUrl("") in 2.x to get the result that our code expects, but perhaps that's bad also? I don't get it. > require.toUrl(".") // "../orion" > require.toUrl("") // "../" Also, making the toUrl("") fix throughout the codebase fixes many hrefs, but there remains a problem where the Page links and Related links in the banner are missing: they don't get rendered at all. The rendering is async and should happen once the message bundles need by all the page links have loaded. For some reason it hangs on the bundle-loading step and never resolves. Didn't debug any further. [1] http://requirejs.org/docs/api.html#modulenotes-urls [2] https://github.com/jrburke/requirejs/issues/515
Opened bug 403082 for the banner links not rendering
Added remarks to bug 373450 about the toUrl() issue mentioned in Comment 2 and Comment 3. I think the way we're calculating OrionHome is wrong.
I refactored all the places that perform OrionHome calculation into a single 'getOrionHome()' function in PageLinks.js: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=df766dfd06b8fe6521c84a83386dc63b6474869a Also opened a CQ requesting legal approval for RequireJS 2.1.5. Once approved, getOrionHome() needs to be updated to work with RequireJS 2 (per Comment 2 and Comment 3). Then this bug can be closed.
CQ got approved for parallel IP. Here's the checkin of RequireJS 2.1.5: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=876a2469ae287b63f267ef022a6baff4c23a6040 Also had to change the implementation of PageLinks#getOrionHome(): http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=617b20a196364346205a494f