-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove jQuery from Recommended Widget #385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the proposal looks good, we'll be breaking BC for browser support on the front-end, and that needs some discussion with the Parse.ly folks as that's a business decision.
|
||
const textDiv = jQuery( '<div>' ).addClass( 'parsely-text-wrapper' ); | ||
fetch( fullUrl ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Fetch API doesn't support IE11, but our defaults
for browserslist includes IE11 (run npx browserslist
in the plugin directory to get the full list).
Since the plugin still supports WP 4.0, then we either need to make a call and document about the widgets not supporting IE11, or not use / provide a workaround for the Fetch API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to provide a workaround, we could use a Polyfill: https://github.com/github/fetch
However, I'm happy to stop supporting IE11. We can clearly state it in the widget configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal stats suggest that IE11 requests account for around 0.1% of requests.
We should also check the behaviour of what the page looks like (is it empty? Does it have a heading but no content? I think there's an issue for this already), but in terms of using fetch()
, ✅.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, there is an open issue about dropping IE 11 in the upcoming release: #325
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check the behaviour of what the page looks like (is it empty? Does it have a heading but no content? I think there's an issue for this already)
Description
This is the last PR on the workstream to remove jQuery dependencies on the plugin. With this work, we've replaced all jQuery-implemented elements with vanilla JS.
In this case, we're removing jQuery from the Recommended Widget. It's one single Javascript file plus the enqueue of jQuery itself on the PHP side. We have rebuilt the assets with
Motivation and Context
#134
How Has This Been Tested?
This has been tested by generating the new assets on a local environment plus a sandbox and visually checking that the contents of the recommended widget are the same as with the old implementation in different browsers.
Known issues
Neither the new or the old implementation work in Firefox (they do in Safari and Chrome). This will be addressed in a separate issue.
Screenshots (if appropriate):
Types of changes
Bug fix (non-breaking change which fixes an issue