Opened 10 years ago
Closed 10 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: |
Description
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)
Change History (3)
Changed 10 years ago by
Attachment: | cache.diff added |
---|
comment:2 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
patch from Chuck Dumont (IBM, CCLA)