Skip to content

chore(storefront): STRF-6720 Update jQuery to 3.4.1 - #1502

Merged
bookernath merged 1 commit into
bigcommerce:masterfrom
bookernath:jq-3.4.1
May 22, 2019
Merged

chore(storefront): STRF-6720 Update jQuery to 3.4.1#1502
bookernath merged 1 commit into
bigcommerce:masterfrom
bookernath:jq-3.4.1

Conversation

@bookernath

Copy link
Copy Markdown
Contributor

What?

Update jQuery version to latest.

Tickets / Documentation

Add links to any relevant tickets and documentation.

@sacr3dc0w

Copy link
Copy Markdown
Contributor

https://www.i-programmer.info/news/167-javascript/12693-sizzle-out-in-jquery-34.html

Now that many of these selectors have made their way into modern browsers, it’s almost time to say goodbye to Sizzle. But in order to remove Sizzle in jQuery 4.0, we will also need to remove what we refer to as positional selectors, which are non-standard selectors.
Specifically, jQuery 3.4.0 is deprecating :first, :last, :eq, :even, :odd, :lt, :gt, and :nth. When we remove Sizzle, we’ll replace it with a small wrapper around querySelectorAll, and it would be almost impossible to reimplement these selectors without a larger selector engine.
We think this trade-off is worth it. Keep in mind we will still support the positional methods, such as .first, .last, and .eq. Anything you can do with positional selectors, you can do with positional methods instead. They perform better anyway.

  • :first
  • :last
  • :eq
  • :even
  • :odd
  • :lt
  • :gt
  • :nth

Line 42 of common/select-option-plugin.js:

Replace:
const $elementNowAtPreviousIndex = selectElement.find(option:eq(${previousIndex}));

With:
const $elementNowAtPreviousIndex = selectElement.find('option').eq(previousIndex);

@bookernath

Copy link
Copy Markdown
Contributor Author

Thanks for the callout @sacr3dc0w ! We'll update.

@bigbot

bigbot commented May 21, 2019

Copy link
Copy Markdown

Autotagging @bigcommerce/storefront-team @davidchin

@sandeepgraju

sandeepgraju commented May 22, 2019

Copy link
Copy Markdown
Contributor

💚 smoke tested manually without util bump. looks good

will also monitor automated tests on staging before including this in next cornerstone release

@bookernath
bookernath merged commit 347e8cf into bigcommerce:master May 22, 2019
@bookernath
bookernath deleted the jq-3.4.1 branch May 22, 2019 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants