Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 453254

Summary: Update RequireJS to 2.1.15
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2014-11-25 17:57:16 EST
It was pointed out on the orion-dev mailing list [1] that we're using requirejs 2.1.5 which contains a bug around module ID normalization.

We should update to 2.1.15 (the latest version).

[1] https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03238.html
Comment 1 Mark Macdonald CLA 2014-11-25 17:57:32 EST
Opened CQ here: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8944
Comment 2 Mark Macdonald CLA 2014-11-29 22:50:58 EST
The CQ has been approved. However I found some issues when running Orion under RequireJS 2.1.15 that need to be resolved before I can merge the new version into master.
Comment 3 Mark Macdonald CLA 2014-12-01 15:37:26 EST
RequireJS 2.1.15 has been merged:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=43e345c
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=211c46d

These were impacted by the upgrade:
- ESLint loader config in the JS plugin
- OrionHome calculation in PageLinks.js


For posterity, here are the old (and apparently incorrect) ways we used to calculate the OrionHome variable in previous versions of RequireJS:

> // RequireJS 1.x:
> // return new URL(require.toUrl("."), window.location).href.slice(0,-1);
> 
> // RequireJS 2.1.5:
> // return new URL(require.toUrl("orion/../"), window.location.href).href.slice(0, -1);

We now do this, which (I hope) is less likely to break in future releases.

> // RequireJS 2.1.15:
> var orionSrcURL = new URL(require.toUrl("orion/"), window.location.href); //$NON-NLS-0$
> return new URL("../", orionSrcURL).href.slice(0, -1); //$NON-NLS-0$