Opened 13 years ago
Closed 9 years ago
#7077 closed defect (worksforme)
Build in GFX requireIf code into layer file
Reported by: | guest | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | low | Milestone: | future |
Component: | BuildSystem | Version: | 1.1.1 |
Keywords: | gfx, build needsreview | Cc: | [email protected]…, [email protected]…, Eugene Lazutkin |
Blocked By: | Blocking: |
Description
I have a custom build 'mybuild.js' and use GFX. When my application initializes, it has to go back to the server to get VML/SVG require files. It would be great if mybuild.js could already include the VML & SVG code within a conditional block.
Change History (6)
comment:1 Changed 13 years ago by
Milestone: | → future |
---|
comment:2 Changed 12 years ago by
Owner: | changed from anonymous to James Burke |
---|
comment:3 Changed 12 years ago by
Cc: | Eugene Lazutkin added |
---|
comment:4 Changed 9 years ago by
Component: | General → BuildSystem |
---|---|
Owner: | changed from James Burke to Rawld Gill |
Status: | new → assigned |
comment:5 Changed 9 years ago by
Keywords: | needsreview added |
---|---|
Priority: | high → low |
i believe this functionality can be achieved via dojo/has or some other means now.
i say this could be closed.
comment:6 Changed 9 years ago by
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
OK, let's close it.
It sounds like a bad idea in general to bloat your build with both VML and SVG just to avoid one extra network request.
But, if one did want to do it, it seems to me (also) that you could just add "dojox/gfx/svg" etc. to your list of required modules (the modules to go into your mybuild.js layer).
Talking more with Jayant about this, here is what might work:
1) Allow definining a layer.forceRequireIf = [
]
2) When evaluating dojo.requireIf calls, if the requireIf condition matches, or if the module name is in the forceRequireIf list, go ahead and include it in the build.
3) Wrap the module in a if (requireIfExpression) {} so that the code only executes at runtime if that condition is met.
Once this works, need to document this somehow so others know about it.