-
Notifications
You must be signed in to change notification settings - Fork 27k
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 handling for prefetching onTouchStart and initial mobile testing #38805
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
bf2cdcb
Add handling for prefetching onTouchStart
ijjk 100c9c0
Merge branch 'canary' into add/touchstart-prefetching
ijjk dfb1fc9
migrate safarit testing to playwright and add mobile tests
ijjk d6d01cd
Merge branch 'canary' into add/touchstart-prefetching
ijjk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -816,13 +816,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: [build, build-native-test] | ||
env: | ||
BROWSERSTACK: true | ||
BROWSER_NAME: 'safari' | ||
NEXT_TELEMETRY_DISABLED: 1 | ||
NEXT_TEST_MODE: 'start' | ||
SKIP_LOCAL_SELENIUM_SERVER: true | ||
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | ||
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | ||
NEXT_TELEMETRY_DISABLED: 1 | ||
steps: | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
|
@@ -851,12 +847,13 @@ jobs: | |
- run: npm i -g pnpm@${PNPM_VERSION} | ||
if: ${{needs.build.outputs.docsChange == 'nope'}} | ||
|
||
# TODO: use macos runner so that we can use playwright to test against | ||
# PRs instead of only running on canary? | ||
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || npm i -g [email protected]' | ||
- run: npx playwright install-deps && npx playwright install webkit | ||
if: ${{needs.build.outputs.docsChange == 'nope'}} | ||
|
||
- run: node run-tests.js -c 1 test/integration/production/test/index.test.js test/e2e/basepath.test.ts | ||
if: ${{needs.build.outputs.docsChange == 'nope'}} | ||
|
||
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js test/e2e/basepath.test.ts' | ||
- run: DEVICE_NAME='iPhone XR' node run-tests.js -c 1 test/production/prerender-prefetch/index.test.ts | ||
if: ${{needs.build.outputs.docsChange == 'nope'}} | ||
|
||
testSafariOld: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we consider using the onPointerEnter to handle all mouse/touch in the future? maybe we can use it to handle touch events first?
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.
Are there any quirks to using
onPointerEnter
vsonMouseEnter
/onTouchStart
? If not and it handles both definitely sounds idealThere 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.
I feel the only blocker is browser support. Previously pointer event wasn't supported quite well among all browsers, I remembered years ago safari doesn't. but now it looks not bad, safari 13 has supported it since 2019.
https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
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 can investigate using pointer events in a follow-up, seems
onTouchStart
should be a good start for compatibility.