Opened 9 years ago

Closed 9 years ago

#15867 closed defect (fixed)

dojo/text interning only works when file extension is .html or .htm or (probably) .css

Reported by: Colin Snover Owned by: Rawld Gill
Priority: blocker Milestone: 1.7.4
Component: BuildSystem Version: 1.7.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Colin Snover)

This is also an issue in 1.7. The build system interns the string as "undefined". The build system needs to allow reading the contents of files with arbitrary file extensions for the dojo/text plugin to work properly.


  1. Create file:
    define([ 'dojo/text!./foo.txt' ], function(foo){ alert(foo); });
  1. Run a build

Expected: Contents of foo.txt always alerted
Actual: "undefined" alerted when application is built

It seems it will work only with any file that matches a "read" transform, which .txt (and many other file extensions) do not.

Change History (7)

comment:1 Changed 9 years ago by Colin Snover

Description: modified (diff)

comment:2 Changed 9 years ago by bill


comment:3 Changed 9 years ago by Rawld Gill

In [29641]:

improve text plugin to read text resources that were not otherwise read; refs #15867; !strict

comment:4 Changed 9 years ago by Rawld Gill

Resolution: fixed
Status: newclosed

In [29642]:

backport [29641]; fixes #15867; !strict

comment:5 Changed 9 years ago by Rawld Gill

The text plugin made the incorrect assumption that all text resources would be read into memory. Changing the design to unconditionally read every resource into memory is expensive in time and space performance. Otoh, having to jump through hoops to get a text plugin resource read with extra config is also not good. Therefore, [29641] improves the design by explicitly reading the file if and only if it's not already available.

Thanks to csnover for the good report and hint.

comment:6 Changed 9 years ago by bill

Resolution: fixed
Status: closedreopened

Doesn't this need to be back ported to the 1.8 branch too?

It looks like just trunk and 1.7.

comment:7 Changed 9 years ago by Rawld Gill

Resolution: fixed
Status: reopenedclosed

In [29650]:

backport [29641]; fixes #15867; !strict

Note: See TracTickets for help on using tickets.