Opened 11 years ago

Closed 11 years ago

#12409 closed defect (duplicate)

unify dojo.cache and requirejs inlined text resources

Reported by: Adam Peller Owned by: James Burke
Priority: high Milestone: tbd
Component: Core Version: 1.6.0rc1
Keywords: require requirejs Cc: ben hockey, [email protected]
Blocked By: Blocking:


Chuck writes:

I've been experimenting with optimized builds produced by requireJS's optimization tools and have discovered that its technique for inlining text resources is not compatible with the dojo.cache integration implemented by the text plugin located in the dojo/lib/plugins directory. This is because when a text resource is inlined into an optimized build, the text plugin is never called to load the resource (it doesn't need to be loaded) so the plugin never gets a chance to add the resource to the dojo cache.

I've come up with a solution that works for inlined and non-inlined text resources, and does not require a custom plugin. It modifies the dojo.cache implementation to use the synchronous mode of the require call to check to see if the resource has already been loaded by the async loader before attempting to load the resource itself

The references to require, the build pragma, and the synchronous reference may need further discussion.

Attachments (1)

cache.diff (824 bytes) - added by Adam Peller 11 years ago.
patch from Chuck Dumont (IBM, CCLA)

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by Adam Peller

Attachment: cache.diff added

patch from Chuck Dumont (IBM, CCLA)

comment:1 Changed 11 years ago by dante

hmm this one has the patch, but it's a duplicate of #12383

comment:2 Changed 11 years ago by Adam Peller

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.