#13183 closed defect (fixed)
[regression]dojo/selector/_loader builder plugin is missing
Reported by: | Rawld Gill | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | BuildSystem | Version: | 1.6.1 |
Keywords: | Cc: | Kris Zyp | |
Blocked By: | Blocking: |
Description
dojo/query uses the plugin dojo/selector/_loader to select a query engine. There is no such plugin available to the builder which causes the builder to not include any query engine in the dojo layer without specifying a custom dojo layer.
Change History (21)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Owner: | set to Rawld Gill |
---|
comment:3 Changed 10 years ago by
Status: | new → assigned |
---|
comment:4 Changed 10 years ago by
Cc: | Kris Zyp added |
---|
Kris: how do you suggest the builder behave re the dojo/selector/_loader plugin?
comment:6 Changed 9 years ago by
My intent was that the "selectorEngine" configuration value would set the selector engine. Is that hard to do?
comment:8 Changed 9 years ago by
Added build switch selectorEngine
, which causes a query selector engine to be baked into the build. If falsy or missing, then no engine is included; otherwise, the engine given by dojo/selector/<selectorEngine> is included.
comment:9 Changed 9 years ago by
Component: | General → BuildSystem |
---|
Looks like these are builder bugs.
comment:10 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
So this is technically a regression, at least in what we serve to the CDN. The expectation of the CDN is a single dojo.js file with all base API's included. The second hit for the selector engine 'acme.js' is sent off (via XHR in non async:1 situations) and fails to load on a CDN.
Perhaps the solution is to simply included this selectorEngine
property in standard.profile.js (the one used for our "release" and now CDN)... incidentally, is there a way to burn in async:true in a built dojo.js via the build? Would that solve the issue of having to set a new parameter to get backwards compatibility?
comment:11 Changed 9 years ago by
Milestone: | 1.7 → 1.8 |
---|---|
Priority: | normal → high |
Summary: | dojo/selector/_loader builder plugin is missing → [regression]dojo/selector/_loader builder plugin is missing |
Type: | enhancement → defect |
comments from rawld, for consideration in 1.8. For 1.7 we'll build in the selector. Which do we choose going forward until 2.0?
Simple fix that requires zero code change is to build one or both selectors into the xdomain distribution.
Simple fix that requires code change is to move the function that detects a xdomain URL into the loader (dojo.js) (and has bracket so we don't pay for it in async builds).
comment:15 Changed 9 years ago by
The test for whether a module is xd is contained in the sync loader backcompat module (dojo/_base/loader). Unfortunately, this module is not loaded in time to test the location of the selector engine, causing the default isXd test to return false, which causes the loader to attempt to load the selector engine via XHR....which fails if dojo is being loaded from a CDN.
The work-around fixes are to build one or all selector engines into the CDN releases.
[27264] fixes this issue so that the selector engine can be determined at runtime and loaded xd.
The question remains open as to which selector engine, if any, should be built into the CDN release; Kris, could you comment?
comment:16 Changed 9 years ago by
I think we will have to bundle acme, for backcompat reasons, at the moment. See also #14398.
comment:19 Changed 9 years ago by
Note that dojo base is not fully loaded immediately after
<script src="xd/path/to/dojo.js></script>
iff the selector engine is loaded xd because it was not included in the built dojo.js.
At first glance the soln is to build with the switch
--selectorEngine acme
However, this will then fail:
<script data-dojo-config="selectorEngine:'lite'" src="xd/path/to/dojo.js></script>
Soln is to bake acme into cdn build; then if you are going to use the lite selector engine with cdn build, you must protect first use of dojo like this (e.g.):
<script> require(["dojo"], function(){ dojo.require("dojo.fx"); }); </script>
(In [25432]) added trivial dojo/selector/_loader plugin for build app that always selects acme; refs #13183