SlideShare a Scribd company logo
Magento and jQuery
Sergii Ivashchenko
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Current jQuery version 1.12.4
(May 20, 2016)
Latest jQuery version 3.6.0
(March 2, 2021)
Goal
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Process
Prepare codebase Update JS libraries Update jQuery and plugins
2.4-develop branch
New features
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
What’s new
 Performance improvements
 Bug fixes
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Promises/A+ support for Deferreds
$.ajax("/status")
.done(function(data) {
dd();
// console shows: ”dd is not a function"
// no further code executes in this function
})
.fail(function(arg) {
// this code does not execute since the exception
was not caught
});
$.ajax("/status")
.then(function(data) {
dd();
// console shows "jQuery.Deferred exception:
dd is not a function"
// no further code executes in this function
})
.catch(function(error) {
// this code executes after the error above
// error is an Error object, ”dd is not a
function"
});
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
New signature for jQuery.get() AND jQuery.post()
$.post({
url: '/foo’,
data: bar
})
$.post('/foo', bar)
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
for...of loops can be used on jQuery collections
var elems =
$(".someclass");
$.each(function(i, elem) {
});
var elems =
$(".someclass");
for ( let elem of elems ) {
}
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
New method jQuery.escapeSelector()
$( "#id.with.dots" ) $( "#" + $.escapeSelector( “id.with.dots" ) )
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
jQuery.readyException
$(function() {
throw new Error('boom!')
});
jQuery.ready.then(function() {
throw new Error('boom');
}).fail(function(error) {
throw error;
});
jQuery.readyException = function(error) {
throw error;
};
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
The .addClass(), .removeClass(), and .toggleClass() methods now
accept an array of classes.
$( ”#id" ).addClass( "selected highlight" );
$( ”#id" ).addClass( [
"selected”,
“highlight”
]);
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Other features
 SVG documents support class operations
 Added support for custom CSS properties
 Added support for <template> elements to the .contents() method
 Locking a Callback prevents only future list execution
 jQuery.ready promise is formally supported
 Animations now use requestAnimationFrame
 nonce and nomodule support
Breaking changes
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
jQuery.ajax() Promises/A+ compliance
$.ajax( "example.php" )
.done(function() {
alert( "success" );
})
.fail(function() {
alert( "error" );
})
.always(function() {
alert( "complete" );
});
$.ajax( "example.php" )
.success(function() {
alert( "success" );
})
.error(function() {
alert( "error" );
})
.complete(function() {
alert( "complete" );
});
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
jQuery.htmlPrefilter
 jQuery( "<div/><span/>" );
 Previous behavior can be restored using jQuery Migrate 3.2.0 or newer
 jQuery.UNSAFE_restoreLegacyHtmlPrefilter();
<div></div>
<span></span>
<div>
<span></span>
</div>
jQuery 3.5
Previously
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Self-closing tags
 <area />
 <base />
 <br />
 <col />
 <embed />
 <hr />
 <img />
 <input />
 <link />
 <meta />
 <param />
 <source />
 <track />
 <wbr />
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
.data() names containing dashes
var $div = $("<div />");
$div.data("click-count", 3);
var allData = $div.data();
allData.clickCount; // 3
allData["click-count"]; // undefined
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
jQuery.ajax() does not remove hash from URL
$.ajax( ”host.com#someparameters" )
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Select multiple value with nothing selected returns an empty array
$(”#select-multiple").val(); // previously null,
now []
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Behavior of :hidden and :visible
 An element is considered visible even if height and/or width of zero
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Cross-domain script requests
 dataType: "script" option has to be specified for jQuery.ajax() or jQuery.get()
 jQuery.getScript() is not affected
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Return values on empty sets are undefined
 Dimensional methods: .width(), .height(), .innerWidth(), .innerHeight(), .outerWidth(),
and .outerHeight()
 Offset methods: .offsetTop() and .offsetLeft()
jQuery().height() // undefined instead of null
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Removed functions and properties
 .andSelf()
 jQuery.event.props
 jQuery.event.fixHooks
 .context and .selector
 .load(), .unload() and .error()
 .size()
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Other BIC
 Dropped IE 6–8 support
 jQuery runs in Strict Mode
 document-ready handlers are now asynchronous
 .width(), .height(), .css("width"), and .css("height") can return non-integer values
 .outerWidth() or .outerHeight() on window includes scrollbar width/height
 jQuery.param() no longer converts %20 to a plus sign
 jQuery("#") throws a syntax error
 .wrapAll(function) only calls the function once
 .removeAttr() no longer sets properties to false
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
Deprecations
 .toggleClass()
 jQuery.unique()
 jQuery.parseJSON()
 .ready()
 .bind()
 .delegate()
 jQuery.holdReady
 jQuery.nodeName
 .on("ready", fn)
 jQuery.now
 jQuery.isWindow
 jQuery.camelCase
 jQuery.proxy
 jQuery.type
 jQuery.isNumeric
 jQuery.isFunction
 Event aliases
 jQuery.isArray
 :first, :last, :eq, :even, :odd, :lt, :gt, and :nth
 jQuery.expr[":"] and jQuery.expr.filters
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
© 2021 Adobe. All Rights Reserved. Adobe Confidential.
How to prepare
 jQuery Migrate and repo documentation
 Upgrade Guides https://jquery.com/upgrade-guide/
 Release blog posts http://blog.jquery.com/
 jQuery API documentation -> Deprecated -> “Removed” label
Watch 2.4-develop branch and stay tuned for our updates!
Migration to jQuery 3.5.x

More Related Content

PPTX
Jquery Complete Presentation along with Javascript Basics
PPT
J query b_dotnet_ug_meet_12_may_2012
 
PDF
Write Less Do More
PPTX
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
PDF
Introduction to jQuery
PDF
jQuery for beginners
PDF
jQuery in 15 minutes
PDF
GDI Seattle - Intro to JavaScript Class 4
Jquery Complete Presentation along with Javascript Basics
J query b_dotnet_ug_meet_12_may_2012
 
Write Less Do More
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
Introduction to jQuery
jQuery for beginners
jQuery in 15 minutes
GDI Seattle - Intro to JavaScript Class 4

What's hot (20)

PDF
jQuery Essentials
PPT
jQuery
PPT
jQuery 1.7 Events
PDF
SwiftUI and Combine All the Things
PDF
jQuery: Nuts, Bolts and Bling
PPTX
jQuery for Sharepoint Dev
PPTX
jQuery Presentation
PPTX
Getting the Most Out of jQuery Widgets
PDF
jQuery and Rails, Sitting in a Tree
PPTX
jQuery Presentasion
PDF
jQuery Loves Developers - Oredev 2009
PPTX
Unobtrusive javascript with jQuery
PDF
Building iPhone Web Apps using "classic" Domino
PDF
Reactive Type-safe WebComponents
PDF
Angular JS blog tutorial
PDF
jQuery Features to Avoid
PPSX
JQuery Comprehensive Overview
PPTX
J Query The Write Less Do More Javascript Library
PPTX
SharePoint and jQuery Essentials
PDF
jQuery Introduction
jQuery Essentials
jQuery
jQuery 1.7 Events
SwiftUI and Combine All the Things
jQuery: Nuts, Bolts and Bling
jQuery for Sharepoint Dev
jQuery Presentation
Getting the Most Out of jQuery Widgets
jQuery and Rails, Sitting in a Tree
jQuery Presentasion
jQuery Loves Developers - Oredev 2009
Unobtrusive javascript with jQuery
Building iPhone Web Apps using "classic" Domino
Reactive Type-safe WebComponents
Angular JS blog tutorial
jQuery Features to Avoid
JQuery Comprehensive Overview
J Query The Write Less Do More Javascript Library
SharePoint and jQuery Essentials
jQuery Introduction
Ad

Similar to Migration to jQuery 3.5.x (20)

PDF
orcreatehappyusers
PDF
orcreatehappyusers
PPTX
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
PDF
Remy Sharp The DOM scripting toolkit jQuery
 
PPTX
2a-JQuery AJAX.pptx
PPTX
jQuery 3 main changes
PDF
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
PPTX
JavaScript!
PPTX
Iniciando com jquery
PPTX
jQuery 3.0 Alpha Versions
PDF
Jquery notes for professionals
PPTX
Introduction to Jquery
PDF
New Features Coming in Browsers (RIT '09)
PPT
jQuery Objects
KEY
Jquery Fundamentals
PPT
JavaScript JQUERY AJAX
PDF
The DOM is a Mess @ Yahoo
PPT
J query presentation
PPT
J query presentation
PPT
JQuery New Evolution
orcreatehappyusers
orcreatehappyusers
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
Remy Sharp The DOM scripting toolkit jQuery
 
2a-JQuery AJAX.pptx
jQuery 3 main changes
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
JavaScript!
Iniciando com jquery
jQuery 3.0 Alpha Versions
Jquery notes for professionals
Introduction to Jquery
New Features Coming in Browsers (RIT '09)
jQuery Objects
Jquery Fundamentals
JavaScript JQUERY AJAX
The DOM is a Mess @ Yahoo
J query presentation
J query presentation
JQuery New Evolution
Ad

More from StanislavIdolov (7)

PPTX
Performance pack introduction
PDF
Live search presentation
PPTX
New contribution delivery channel
PDF
Predictive test selection with machine learning
PPTX
Magento Community Hangouts 10 Feb, 2021 Performance Improvements
PDF
Magento Community Hangouts 10 Feb, 2021 Composer 2 Support
PPTX
Magento Community Hangouts 10 Feb, 2021 PHP 8 support
Performance pack introduction
Live search presentation
New contribution delivery channel
Predictive test selection with machine learning
Magento Community Hangouts 10 Feb, 2021 Performance Improvements
Magento Community Hangouts 10 Feb, 2021 Composer 2 Support
Magento Community Hangouts 10 Feb, 2021 PHP 8 support

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
ai tools demonstartion for schools and inter college
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Nekopoi APK 2025 free lastest update
PPTX
Introduction to Artificial Intelligence
PPTX
L1 - Introduction to python Backend.pptx
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
System and Network Administraation Chapter 3
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Transform Your Business with a Software ERP System
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
medical staffing services at VALiNTRY
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
ai tools demonstartion for schools and inter college
Wondershare Filmora 15 Crack With Activation Key [2025
Reimagine Home Health with the Power of Agentic AI​
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How Creative Agencies Leverage Project Management Software.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Odoo POS Development Services by CandidRoot Solutions
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Nekopoi APK 2025 free lastest update
Introduction to Artificial Intelligence
L1 - Introduction to python Backend.pptx
wealthsignaloriginal-com-DS-text-... (1).pdf
System and Network Administraation Chapter 3
2025 Textile ERP Trends: SAP, Odoo & Oracle
CHAPTER 2 - PM Management and IT Context
Transform Your Business with a Software ERP System
Softaken Excel to vCard Converter Software.pdf
medical staffing services at VALiNTRY

Migration to jQuery 3.5.x

  • 2. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Current jQuery version 1.12.4 (May 20, 2016) Latest jQuery version 3.6.0 (March 2, 2021) Goal
  • 3. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Process Prepare codebase Update JS libraries Update jQuery and plugins 2.4-develop branch
  • 5. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. What’s new  Performance improvements  Bug fixes
  • 6. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Promises/A+ support for Deferreds $.ajax("/status") .done(function(data) { dd(); // console shows: ”dd is not a function" // no further code executes in this function }) .fail(function(arg) { // this code does not execute since the exception was not caught }); $.ajax("/status") .then(function(data) { dd(); // console shows "jQuery.Deferred exception: dd is not a function" // no further code executes in this function }) .catch(function(error) { // this code executes after the error above // error is an Error object, ”dd is not a function" });
  • 7. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. New signature for jQuery.get() AND jQuery.post() $.post({ url: '/foo’, data: bar }) $.post('/foo', bar)
  • 8. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. for...of loops can be used on jQuery collections var elems = $(".someclass"); $.each(function(i, elem) { }); var elems = $(".someclass"); for ( let elem of elems ) { }
  • 9. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. New method jQuery.escapeSelector() $( "#id.with.dots" ) $( "#" + $.escapeSelector( “id.with.dots" ) )
  • 10. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. jQuery.readyException $(function() { throw new Error('boom!') }); jQuery.ready.then(function() { throw new Error('boom'); }).fail(function(error) { throw error; }); jQuery.readyException = function(error) { throw error; };
  • 11. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. The .addClass(), .removeClass(), and .toggleClass() methods now accept an array of classes. $( ”#id" ).addClass( "selected highlight" ); $( ”#id" ).addClass( [ "selected”, “highlight” ]);
  • 12. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Other features  SVG documents support class operations  Added support for custom CSS properties  Added support for <template> elements to the .contents() method  Locking a Callback prevents only future list execution  jQuery.ready promise is formally supported  Animations now use requestAnimationFrame  nonce and nomodule support
  • 14. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. jQuery.ajax() Promises/A+ compliance $.ajax( "example.php" ) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "complete" ); }); $.ajax( "example.php" ) .success(function() { alert( "success" ); }) .error(function() { alert( "error" ); }) .complete(function() { alert( "complete" ); });
  • 15. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. jQuery.htmlPrefilter  jQuery( "<div/><span/>" );  Previous behavior can be restored using jQuery Migrate 3.2.0 or newer  jQuery.UNSAFE_restoreLegacyHtmlPrefilter(); <div></div> <span></span> <div> <span></span> </div> jQuery 3.5 Previously
  • 16. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Self-closing tags  <area />  <base />  <br />  <col />  <embed />  <hr />  <img />  <input />  <link />  <meta />  <param />  <source />  <track />  <wbr />
  • 17. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. .data() names containing dashes var $div = $("<div />"); $div.data("click-count", 3); var allData = $div.data(); allData.clickCount; // 3 allData["click-count"]; // undefined
  • 18. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. jQuery.ajax() does not remove hash from URL $.ajax( ”host.com#someparameters" )
  • 19. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Select multiple value with nothing selected returns an empty array $(”#select-multiple").val(); // previously null, now []
  • 20. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Behavior of :hidden and :visible  An element is considered visible even if height and/or width of zero
  • 21. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Cross-domain script requests  dataType: "script" option has to be specified for jQuery.ajax() or jQuery.get()  jQuery.getScript() is not affected
  • 22. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Return values on empty sets are undefined  Dimensional methods: .width(), .height(), .innerWidth(), .innerHeight(), .outerWidth(), and .outerHeight()  Offset methods: .offsetTop() and .offsetLeft() jQuery().height() // undefined instead of null
  • 23. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Removed functions and properties  .andSelf()  jQuery.event.props  jQuery.event.fixHooks  .context and .selector  .load(), .unload() and .error()  .size()
  • 24. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Other BIC  Dropped IE 6–8 support  jQuery runs in Strict Mode  document-ready handlers are now asynchronous  .width(), .height(), .css("width"), and .css("height") can return non-integer values  .outerWidth() or .outerHeight() on window includes scrollbar width/height  jQuery.param() no longer converts %20 to a plus sign  jQuery("#") throws a syntax error  .wrapAll(function) only calls the function once  .removeAttr() no longer sets properties to false
  • 25. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. Deprecations  .toggleClass()  jQuery.unique()  jQuery.parseJSON()  .ready()  .bind()  .delegate()  jQuery.holdReady  jQuery.nodeName  .on("ready", fn)  jQuery.now  jQuery.isWindow  jQuery.camelCase  jQuery.proxy  jQuery.type  jQuery.isNumeric  jQuery.isFunction  Event aliases  jQuery.isArray  :first, :last, :eq, :even, :odd, :lt, :gt, and :nth  jQuery.expr[":"] and jQuery.expr.filters
  • 26. © 2021 Adobe. All Rights Reserved. Adobe Confidential. © 2021 Adobe. All Rights Reserved. Adobe Confidential. How to prepare  jQuery Migrate and repo documentation  Upgrade Guides https://jquery.com/upgrade-guide/  Release blog posts http://blog.jquery.com/  jQuery API documentation -> Deprecated -> “Removed” label Watch 2.4-develop branch and stay tuned for our updates!