Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13058 closed enhancement (fixed)

implement dojo.moduleUrl in terms of AMD loader API

Reported by: Rawld Gill Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: Loader Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

1. With v1.7, the loader is responsible for mapping modules to URLs. Since the loader may be a foreign loader, dojo should not implement dojo.moduleUrl directly, but rather should delegate to the AMD loader API.

2. dojo.moduleUrl returns a dojo._Url instance yet the return value is always immediately converted to a string. Therefore, dojo.moduleUrl should be changed to return a string.

3. dojo.moduleUrl returns null if the module argument is falsy. There is no point in this logic and it should be removed.

4. dojo._Url, a private class, is not used in dojo, dijit, dojox, or demos; it should be moved out of base and put into a separate module for inclusion iff client code requires it.

Change History (9)

comment:1 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: newclosed

(In [25152]) fixes #13058; fixes #12788; !strict

comment:2 Changed 8 years ago by bill

(In [25210]) conform to other uses of moduleUrl() like moduleUrl(directory, fileName), refs #13058

comment:3 Changed 8 years ago by bill

(In [25212]) fix typo in previous checkin to conform to other uses of moduleUrl() with pattern dojo.moduleUrl(directory, fileName), refs #13058

comment:4 Changed 8 years ago by Rawld Gill

(In [25300]) added missing dojo/_base/url module in deps vectors; improved dojo/base/url; refs #13058; !strict

comment:5 Changed 8 years ago by Rawld Gill

(In [25301]) removed debugging noise; refs #13058

comment:6 Changed 8 years ago by Adam Peller

Resolution: fixed
Status: closedreopened

dojo.moduleUrl used to return a string with a trailing slash, but no longer does. This breaks existing code. Can we restore the trailing slash?

comment:7 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: reopenedclosed

(In [25547]) reverted back-notcompat changes to dojo.moduleUrl to make it 100% backcompat; added/changed tests; fixes #13058; !strict

comment:8 Changed 8 years ago by Rawld Gill

(In [25549]) corrected deprecated message; refs #13058; !strict

comment:9 Changed 8 years ago by bill

(In [25557]) Use require.toUrl() rather than deprecated dojo.moduleUrl(), refs #13058 !strict.

Note: See TracTickets for help on using tickets.