Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13894 closed defect (fixed)

baseless dojo/query breaks in old IEs on query("#idselector")

Reported by: Kenneth G. Franqueiro Owned by: Kris Zyp
Priority: high Milestone: 1.7
Component: Query Version: 1.7.0b1
Keywords: query Cc:
Blocked By: Blocking:


Just stumbled into this while testing some code against trunk in IE7.

The following simple code will reproduce the issue in IE <= 8:

<!DOCTYPE html>
		<div id="foo"></div>
		<script src="dojo/dojo.js" data-dojo-config="async:1"></script>
require(["dojo/query"], function(query){

It looks like the issue may go deeper than simply mistakenly referencing dojo.byId though - upon inspection, it appears that dojo/selector/acme.js attempts to pull in granular deps (pulling in kernel.js as the dojo object), yet is using a bunch of methods straight off the dojo namespace.

This is also a problem in lite.js, but there byId seems to be the only real dependency, which is easy enough to fix granularly.

By the looks of it, the most expedient fix to this for acme.js would be to forego the idea of granular deps on these modules for the time being, unless someone has time to spend converting them properly.

Change History (4)

comment:1 Changed 10 years ago by Kenneth G. Franqueiro

Summary: [regression] baseless dojo/query breaks in old IEs on query("#idselector")baseless dojo/query breaks in old IEs on query("#idselector")

After stepping away from the keyboard for a while I realized 2 things:

  • It was probably wrong of me to initially mark this as a regression, since it only happens when running baseless.
  • I suppose the style employed by acme.js of pulling in kernel + granular deps, but still leaning on the dojo namespace, may be intentional in order to reduce deps while still keeping the code mostly as-is. I didn't think we tended to go with this pattern, but if acme.js is a reasonable exception then I guess we can just add the missing deps (e.g. dojo/dom). lite.js could still go either way since it's new and just the one missing dep AFAIK.
Last edited 10 years ago by Kenneth G. Franqueiro (previous) (diff)

comment:2 Changed 10 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

In [26551]:

Add dom dep for byId call, fixes #13894 !strict

comment:3 Changed 10 years ago by Kris Zyp

Also note that selector/lite.js doesn't have a hard dependency on byId, it checks for the presence of byId before using it.

comment:4 Changed 10 years ago by bill

I filed #14204 to track fixing acme.js to be baseless.

As for lite.js (and a few other similar modules), I think the part about leaning on the dojo namespace will need to be removed before #13959 can be completed.

Note: See TracTickets for help on using tickets.