Opened 9 years ago
Closed 6 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: |
Description
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)
Change History (3)
Changed 9 years ago by
Attachment: | repeatedParse.html added |
---|
comment:1 Changed 9 years ago by
Milestone: | tbd → 2.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 6 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
The core issue here is fixed by how Web Components work (either native implementation or polyfill, like http://ibm-js.github.io/delite/). 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.
test case to show error on double parse