Ticket #9321 (closed enhancement: wontfix)

Opened 9 months ago

Last modified 8 months ago

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

Reported by: dante Owned by: jburke
Priority: normal Milestone: tbd
Component: BuildSystem Version: 1.3.0
Severity: normal Keywords:
Cc:

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

templatePath.patch (1.5 kB) - added by dante 9 months ago.

Change History

Changed 9 months ago by dante

Changed 9 months ago by jburke

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.

Changed 9 months ago by jburke

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

Changed 9 months ago by jburke

  • status changed from new to closed
  • resolution set to wontfix

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.

Changed 8 months 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.