Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12907 closed defect (fixed)

[regression]dojo.parser needs explicit dojo.require in 1.7

Reported by: Douglas Hays Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: Parser Version: 1.6.1
Keywords: Cc: bill, Chris Mitchell
Blocked By: Blocking:

Description

In dojo 1.6, you could specify parseOnLoad:true in djConfig and the dojo.parser would automatically be run even if you did not do a dojo.require('dojo.parser') in the web page's HEAD section. Starting with Dojo 1.7, you have to add the dojo.require. Since this will affect backward compatibility, I wanted to make sure this was intentional before we ship 1.7.

Change History (13)

comment:1 Changed 8 years ago by Chris Mitchell

Priority: normalhigh
Summary: dojo.parser needs explicit dojo.require in 1.7[regression]dojo.parser needs explicit dojo.require in 1.7

marking mustfix 1.7

comment:2 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

This is expected behavior, although the characterization in this ticket is a little off. From the 1.7 release notes (migration section):

  • You may need to explicitly require the following modules which were getting implicitly loaded before:
    • dojo.parser (many widgets which used to include the parser no longer do)

In other words, dojo.require('dojo.parser') was required since 1.0, but you just got away with it until now.

comment:3 Changed 8 years ago by bill

Note that this change is unrelated to the AMD work, it's just part of our code refactor to streamline for mobile.

comment:4 Changed 8 years ago by Chris Mitchell

Resolution: wontfix
severity: normalmajor
Status: closedreopened

there is a very large # of customers that will be broken if this is the new behavior. If there is technically a way to keep this working with the same behavior as 1.6, we should through the 1.x stream, and note deprecation in debug log.

comment:5 Changed 8 years ago by bill

Component: CoreParser
Resolution: wontfix
Status: reopenedclosed

Sorry, but this is the direction we are going for 1.7, to allow lightweight applications (especially mobile). See #12432 for details, and note that any of the changes associated with that ticket will cause similar problems.

comment:6 Changed 8 years ago by Douglas Hays

For the record, adding "dojo/parser" to the define for _Widget.js would prevent almost all backward compat issues and doesn't seem to affect mobile at all.

comment:7 Changed 8 years ago by Chris Mitchell

Resolution: wontfix
Status: closedreopened

why are we not considering the fix doug recommends for 1.x? This will result in many customer defects coming in.

comment:8 Changed 8 years ago by bill

Resolution: invalid
Status: reopenedclosed

As explained in #12275, the goal is lightweight templated widgets. It's not strictly for mobile, but it affects any mobile application using widgets from dijit.

And again, this is not a regression, it's operating according to the original spec from 1.0.

Stop reopening this ticket.

comment:9 Changed 8 years ago by bill

comment:10 Changed 8 years ago by Douglas Hays

How about appending this to the end of _Widget.js (or any other JS file) in order to throw a deprecated warning:

if(dojo.config.parseOnLoad && !dojo.isAsync && !dojo.parser){
        dojo.ready(99, function(){
                if(!dojo.parser){
                        dojo.deprecated("Add explicit dojo.require('dojo.parser');", "", "2.0");
                        dojo.require("dojo.parser");
                }
        });
}

comment:11 Changed 8 years ago by bill

Adding that code to _TemplatedMixin would fix the "regression" in dijit. Adding it to _WidgetBase would fix the "regression" in dojox.charting (since the charting widgets were changed to not use templates, thus no longer pulling in the parser), albeit breaking dojox.mobile apps which already load an alternate parser.

But, if users expect the parseOnLoad flag to automatically load the parser, it should really happen regardless of whether anything in dijit is loaded or not. (Remember that parser is part of dojo core, not part of dijit.) So, last time I talked to Rawld he thought that made sense, to put the code to load the parser into the kernel.

comment:12 Changed 8 years ago by Rawld Gill

Resolution: invalidfixed

(In [25467]) moved dojo.ready calls in base to dojo/ready module; added feature to load parser as per #12907; fixes #12907; refs #13113

comment:13 Changed 8 years ago by bill

(In [25522]) remove unneeded parseOnLoad: true from robot test files, refs #12907

Note: See TracTickets for help on using tickets.