Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13597 closed defect (fixed)

packageMap not working after a build

Reported by: ben hockey Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: Loader Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description

i'm attaching a test file and a build profile that i'm trying to get working with source and built versions of dojo. currently it works perfectly with source but fails when running against a built version of dojo.

i'm open to adjusting any part of my approach to reach the final goal of having the globals mapped to alternative names in both source and built versions. ideally, i don't want to have to change my configuration for source and built though - ie ideally this single html file should work against source or built without any changes if possible.

NOTE: the profile contains a layer called loader and that's just the location of where i have the html file - its simply for convenience so that the packageMap.html file is copied over during a build.

i would also be ok with being able to change the values of the globals (_scopeName) independently of changing the module ids if that's simpler to achieve.

Attachments (3)

packageMap.html (1.2 KB) - added by ben hockey 8 years ago.
pmap.profile.js (138 bytes) - added by ben hockey 8 years ago.
loader.zip (1.0 KB) - added by Rawld Gill 8 years ago.
original example, cleaned up to eliminate unneeded config, include required config; install as sibling of dojo

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by ben hockey

Attachment: packageMap.html added

Changed 8 years ago by ben hockey

Attachment: pmap.profile.js added

comment:1 Changed 8 years ago by Rawld Gill

Milestone: tbd1.7
Status: newassigned

comment:2 Changed 8 years ago by Rawld Gill

Resolution: worksforme
Status: assignedclosed

Just tried this and it seemed to work OK exactly as you provided, both built and unbuilt. I've been constantly improving this feature over the last few months, so one of those improvements likely fixed this problem.

comment:3 Changed 8 years ago by ben hockey

Resolution: worksforme
Status: closedreopened

this still doesn't work.

an error is thrown when loading packageMap.html after a build.

fyi - the build is run via the following command ./build.sh -p pmap --release. packageMap.html is in a directory called loader that is a sibling of dojo, dijit, et al and pmap.profile.js is in util/buildscripts/profiles/.

the best i can decode from the error is that the info has message is "multipleDefine" and the mid is "dojo/domReady" and the src is "dojoLoader".

comment:4 Changed 8 years ago by Rawld Gill

There are two problems:

  1. The build flag insertAbsMids must be falsy in order for the packageMap feature to work.
  1. The loader is not reverse mapping to built resources. Therefore, with insertAbsMids, the sample would load correctly, but would not reference the dojo modules in the loader cache (put there by the build app).

Problem 2 is solved by inspecting the cache for the reverse map of a module.

comment:5 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: reopenedclosed

In [26719]:

added loader feature for mapped packages to look in loader cache using reverse map; \!strict; fixes #13597

Changed 8 years ago by Rawld Gill

Attachment: loader.zip added

original example, cleaned up to eliminate unneeded config, include required config; install as sibling of dojo

comment:6 Changed 8 years ago by Rawld Gill

The attached example can be installed as a sibling of dojo. Run the command

./build.sh --profile ../../loader/pmap.profile.js --release

from util/buildscripts to see the built version of the program.

Note: See TracTickets for help on using tickets.