Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#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 8 years ago by Rawld Gill

(In [25432]) added trivial dojo/selector/_loader plugin for build app that always selects acme; refs #13183

comment:2 Changed 8 years ago by Douglas Hays

Owner: set to Rawld Gill

comment:3 Changed 8 years ago by Rawld Gill

Status: newassigned

comment:4 Changed 8 years ago by Rawld Gill

Cc: Kris Zyp added

Kris: how do you suggest the builder behave re the dojo/selector/_loader plugin?

comment:5 Changed 8 years ago by Rawld Gill

See also complaint in #13198.

comment:6 Changed 8 years ago by Kris Zyp

My intent was that the "selectorEngine" configuration value would set the selector engine. Is that hard to do?

comment:7 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [26709]:

added build switch to select query engine; fixes #13183; !strict

comment:8 Changed 8 years ago by Rawld Gill

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 8 years ago by bill

Component: GeneralBuildSystem

Looks like these are builder bugs.

comment:10 Changed 8 years ago by dante

Resolution: fixed
Status: closedreopened

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 8 years ago by Adam Peller

Milestone: 1.71.8
Priority: normalhigh
Summary: dojo/selector/_loader builder plugin is missing[regression]dojo/selector/_loader builder plugin is missing
Type: enhancementdefect

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:12 Changed 8 years ago by Adam Peller

In [27089]:

refs #13183 add acme selector engine to script for 1.7

comment:13 Changed 8 years ago by Adam Peller

In [27090]:

refs #13183 add acme selector engine (without path) to script for 1.7

comment:14 Changed 7 years ago by Rawld Gill

In [27264]:

moved isXd test into core loader so that it's always available; refs #13183; !strict

comment:15 Changed 7 years ago by Rawld Gill

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 7 years ago by Kenneth G. Franqueiro

I think we will have to bundle acme, for backcompat reasons, at the moment. See also #14398.

comment:17 Changed 7 years ago by Rawld Gill

In [27295]:

bake acme into standard build; refs #13183

comment:18 Changed 7 years ago by Rawld Gill

Resolution: fixed
Status: reopenedclosed

In [27296]:

bake acme into standard build; fixes #13183

comment:19 Changed 7 years ago by Rawld Gill

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>

comment:20 Changed 7 years ago by Rawld Gill

In [27298]:

backport [27264]; refs #13183; !strict

comment:21 Changed 7 years ago by Kenneth G. Franqueiro

In [27320]:

No longer need to add selectorEngine=acme to cdn build command line since it is baked into standard profile; refs #13183

Note: See TracTickets for help on using tickets.