Opened 10 years ago

Closed 7 years ago

#15511 closed enhancement (fixed)

guard against double parse

Reported by: bill Owned by: bill
Priority: undecided Milestone: 2.0
Component: Parser Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


Perhaps the parser should remove the data-dojo-type attribute from parsed nodes, to guard against the user error of parsing the same block of DOMNodes twice.

It would avoid the frequent

Error: Tried to register widget with id==dijit_layout_ContentPane_0 but that id is already registered

error that confused users often complain about.

Attachments (1)

repeatedParse.html (846 bytes) - added by bill 10 years ago.
test case to show error on double parse

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by bill

Attachment: repeatedParse.html added

test case to show error on double parse

comment:1 Changed 10 years ago by bill

Milestone: tbd2.0

Marking this for 2.0 since removing data-dojo-type from nodes would be marginally backwards incompatible.

Although an alternate approach would be to set a alreadyParsed flag on nodes that were already parsed... or practically speaking we could just check for the widgetid attribute, which is set on anything that extends dijit/_WidgetBase, but not parsed nodes like dojo.dnd.Source.

comment:2 Changed 7 years ago by bill

Resolution: fixed
Status: newclosed

The core issue here is fixed by how Web Components work (either native implementation or polyfill, like There is no manual parse() call, and createdCallback() only gets executed once for a given node. So closing this ticket as fixed in 2.0.

Note: See TracTickets for help on using tickets.