Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9321 closed enhancement (wontfix)

build interning matches more than necessary. please don't fix.

Reported by: dante Owned by: James Burke
Priority: high Milestone: tbd
Component: BuildSystem Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description

as a side effect of the build using regexp to match "templatePath: moduleUrl" etc, it is possible to make alternate members inlined following the same pattern. eg:

dojo.declare("Thinger", null, {

    sometemplatePath: dojo.moduleUrl("foo", "Bar.html"),
    anothertemplatePath: dojo.moduleUrl("foo", "Baz.html")

});

Both are properly converted to sometemplateString and anotherTemplateString respectively. Is this a bug or a feature? I vote feature, which leads me to this enhancement request:

sometemplatePath should probably be someTemplatePath to allow following of the dojo style guidelines. Attach is a trivial patch supporting this and maintaining back compat.

Attachments (1)

templatePath.patch (1.5 KB) - added by dante 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by dante

Attachment: templatePath.patch added

comment:1 Changed 10 years ago by James Burke

Back in 0.4, we had a dojo.uri.cache that allowed for this sort of thing, and kept an internal cache of the moduleUrls it loaded: http://bugs.dojotoolkit.org/browser/tags/release-0.4.3/src/uri/cache.js

It was also plugged into the build system so that the build system inlined dojo.uri.cache.get() calls.

It might be easiest/best/most generic to bring that back. It accomplishes the 'if moduleUrl load it otherwise use string' logic too.

comment:2 Changed 10 years ago by James Burke

I would like dojo.urlCache instead of dojo.uri.cache, btw.

comment:3 Changed 10 years ago by James Burke

Resolution: wontfix
Status: newclosed

I added dojo.cache as part of #9341. So I'm going to close this ticket in favor of that approach, but give a holler if you find it lacking.

comment:4 Changed 10 years ago by dante

just to note: do NOT apply this patch. If we are to deprecate "templatePath" support (but leave it in the build for legacy reasons) it is BETTER to not match properly camelCased variables.

the [tT]emplate regexp change was intended to match childTemplatePath too, and would be easier if we explicitly don't intern those style variables and better document the use of dojo.cache for this purpose.

Note: See TracTickets for help on using tickets.