-
Notifications
You must be signed in to change notification settings - Fork 820
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
Add legacy bundle to test old browser compatibility #233
Conversation
5134eda
to
61adedb
Compare
script: | ||
- xvfb-run npm run test | ||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --plugin sauce; fi | ||
- xvfb-run npm run test && if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then ./scripts/run-sauce-tests.sh; fi |
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.
Does this only run the sauce tests when a commit lands on master?
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 environment variable is a little misleading. Basically this only runs sauce tests for first-party PRs (so that malicious users cannot burn our finite sauce time) and for merges into master. TBD how we should go about running the full battery of browsers against third-party PRs, but open to suggestions.
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.
Great work! One thing that I'd like is some sort of info on what features trigger the need for a legacy build/test, e.g. something in the readme Browser Support section
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x |
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.
Why do you need to flip the chmod flags?
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.
These aren't chmod
flags. These set
flags tell the shell to:
- Exit the script on the first non-zero exit code (otherwise it would invoke all commands even if they fail)
- Print all the commands being run by the script as they are invoked
See https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html#The-Set-Builtin
@@ -21,11 +21,13 @@ | |||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> |
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.
Could we move test.html and test-legacy.html to test/
maybe? Or test/index.html
and test/legacy.html
? Could also contain a README about writing tests (in the future) -- main rational being to minimize things in the root
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.
👍
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.
Done
test.html
Outdated
@@ -45,13 +47,13 @@ | |||
<!-- Resize Observer polyfill is required for non-Chrome browsers: --> | |||
<script src="./node_modules/resize-observer-polyfill/dist/ResizeObserver.js"></script> | |||
|
|||
<!-- Fullscreen polyfill is required to support all stable browsers: --> | |||
<!-- Fullscreen polyfill is required to support Web XR-based AR in stable browsers that support it: --> |
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.
nit: s/Web XR/WebXR
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.
Will fix
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.
Done
wct-legacy.conf.json
Outdated
"version": "11.285" | ||
}, | ||
{ | ||
"browserName": "safari", |
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.
Does Safari 11.1 need the legacy build?
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.
Probably not. I'll move it up.
Now that I think about it, it's probably valuable to ensure latest Chrome works against the legacy bundle, as the code is changed very significantly.
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.
Done
test-legacy.html
Outdated
|
||
<!-- The following libraries and polyfills are recommended to maximize browser support --> | ||
<!-- Include prismatic.js for Magic Leap support: --> | ||
<!--<script src="../node_modules/@magicleap/prismatic/prismatic.min.js"></script>--> |
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.
This should probably be removed here and in test.html
since it doesn't actually do anything when running tests AFAIK (we don't run tests on Helio or shim prismatic connection)
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.
Will fix.
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.
Done
a45f85e
to
d98b34c
Compare
Added docs about the legacy bundle and Custom Elements ES5 Adapter |
Important details about this change:
wct
parses command line options (filed WCT ignores --local when sauce plugin is skipped Polymer/tools#798 to track)polymer-build
is used to generate a "legacy"-compatible bundlepolymer-build
is maintained and updated by a dedicated team of folks so it saves us some of that burden.remove
on elements, so all usages have been changed to a more conservative check forparentNode
and then usingremoveChild
on that node if it exists.Fixes #99