Skip to content

Upgrade guide: Add more details to the jQuery 3.5 upgrade guide#202

Merged
mgol merged 2 commits intojquery:masterfrom
mgol:upgrade-guide-updates
Jun 10, 2020
Merged

Upgrade guide: Add more details to the jQuery 3.5 upgrade guide#202
mgol merged 2 commits intojquery:masterfrom
mgol:upgrade-guide-updates

Conversation

@mgol
Copy link
Member

@mgol mgol commented May 11, 2020

The commit adds information about jQuery Migrate 3.3.0+ logging of non-compliant
HTML input. It also explicitly states the common example of using a single
auto-closing tag works even in jQuery 3.5.0+.

There are also tweaks in other places.

@mgol mgol self-assigned this May 11, 2020
The commit adds information about jQuery Migrate 3.3.0+ logging of non-compliant
HTML input. It also explicitly states the common example of using a single
auto-closing tag works even in jQuery 3.5.0+.

There are also tweaks in other places.
@mgol mgol force-pushed the upgrade-guide-updates branch from b13ac01 to dc7c5bc Compare May 11, 2020 16:19
Copy link
Member

@dmethvin dmethvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I made it better or not, but wanted to propose another way to express the whole HTML5 parsing thing. I'm good either way.

because `<div/>` was replaced with `<div></div>` & `<span/>` with `<span></span>`.

jQuery 3.5.0 has changed `jQuery.htmlPrefilter` to be an identity function. That means that the above `jQuery` call would now create above HTML structure only in XML mode of HTML (called also as XHTML) but in regular HTML mode you would now get:
jQuery 3.5.0 has changed `jQuery.htmlPrefilter` to be an identity function. In HTML mode auto-closing tags are being replaced with their opening tags, making `<div/><span/>` interpreted as `<div><span>`; the browser will automatically close these tags at the end of input. That means that the above `jQuery` call would now create above HTML structure only in XML mode of HTML (called also as XHTML) but in regular HTML mode you would now get:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if people understand what "HTML mode" is nowadays. XHTML is pretty archaic!

I think the important point here is that the new interpretation of this string is being done by the browser's HTML5 parser and not jQuery.

Copy link
Member Author

@mgol mgol Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just didn't want to imply that <div/><span/> will always be converted to the nested structure by the browser as in XML mode it won't happen. Maybe I'll cut the XML part out. Your changes look mostly good so I'll reuse them, thanks. :)

Co-Authored-By: Dave Methvin <dave.methvin@gmail.com>
@mgol
Copy link
Member Author

mgol commented Jun 5, 2020

@dmethvin Can you have another look? I added another commit with your suggestions & some of my own.

Copy link
Member

@timmywil timmywil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mgol mgol merged commit a5ad9a7 into jquery:master Jun 10, 2020
@mgol mgol deleted the upgrade-guide-updates branch June 10, 2020 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants