Commit graph

34 commits

Author SHA1 Message Date
Tim Neutkens
f260328900
BREAKING CHANGE: Enable newNextLinkBehavior (#41459)
- Enable newNextLinkBehavior. See #36436 
- Run next/link codemod on test suite

Note that from when this lands on apps trying canary will need to run
the new-link codemod in order to upgrade.
Ideally we have to detect `<a>` while rendering the new link and warn
for it.

Co-authored-by: Steven <steven@ceriously.com>
2022-10-17 21:20:28 -04:00
Jiachi Liu
092346d333
test: clean up duplicated tests (#36871)
Clean up integration tests

* app-document: Merge multi fetch reuqests into 1, add checking for `__NEXT_DATA__`
* rsc/streaming: Merge duplicated tests, move the head tests to client-navigation since they're running under react 18 now
* remove runtime subtest suite under rsc tests since it's covered in switchable runtime test suite
2022-05-13 00:46:12 +00:00
Jiachi Liu
adb56ef2bc
Enable html post optimization for react 18 (#36837)
Follow up for #35888 to re-enable more test, and re-enable post processors after #36792 has better support for document.gIP with react 18. Apply post-pocessing when the the shell chunk is fully buffered.

re-enabled integration tests for react 18:
- amphtml
- amphtml-custom-optimizer
- app-document
- font-optimization

Fixes #35835


## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-05-12 17:41:37 +00:00
Jiachi Liu
4de5b64c0b
Wait for shell resolve with gIP is customized in react 18 (#36792)
When getInitialProps is customized with react 18, since gIP requires to return `html` as doc property which could be used by  user-land customization, we do blocking-rendering there and passdown the `html` to document

Fixes #36675
Closes #36419
2022-05-11 13:25:23 +00:00
JJ Kasper
4a7ab34baf
Update repo to use react 18 by default (#35888)
This updates our `yarn next` command to leverage react v18 by default and removes the need for the test require hook/config modifying when testing react 18. There are some fixtures we need to investigate react 18 support in follow-ups:

- `test/integration/client-navigation-a11y`
- `test/integration/critical-css`
- `test/integration/custom-error-page-exception`
- `test/integration/font-optimization`
- AMP specific tests
2022-04-05 21:51:47 +00:00
Konstantin Popov
16c3e6f613
Fix minor typo in index.test.js (#29065)
Fix minor typo:

suits -> suites
2021-09-13 14:56:56 -05:00
JJ Kasper
a92a5caec2
Update test set-up to leverage playwright when able to (#28634)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-13 14:36:25 +02:00
JJ Kasper
5544adc481
Update to latest babel versions (#28174) 2021-08-17 09:18:08 +02:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Jan Potoms
714747957a
Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
Jan Potoms
32057c849d
Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
JJ Kasper
e28de80d6c Fix up errors in tests (#9407)
* Fix up errors in tests

* Fix test

* Apply suggestions from code review

* Update require-page.test.js

* Update require-page.test.js
2019-11-13 14:18:06 -08:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
JJ Kasper
bf11421992 Add deprecation warning for App Container (#8475)
* Add deprecation warning for App Container

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Tweak for more dead-code elimination
2019-08-22 16:19:15 -04:00
JJ Kasper
6ddb5ee341 Update to check browserName instead of browser.log (#8234)
* Update to check browserName instead of browser.log

* Fix browserName check for some tests
2019-08-04 15:44:32 +02:00
JJ Kasper
13fa2828c2 Add missing key prop for array elements in _document (#8132)
* Add missing keys for array elements

* Add test for missing key prop in app-document
2019-07-27 10:34:29 +02:00
Joe Haddad
b3170d2648
Format missed files (#7464)
* Format missed files

* Remove unnecessary rule

* Fix type error
2019-05-29 18:19:32 -07:00
JJ Kasper
14eef58702 Re-add chromedriver retrying from previous webdriver setup (#6846)
* Re-add previous webdriver setup with falling
back to BrowserStack setup

* Add missing webdriver imports
2019-04-01 16:09:09 +02:00
JJ Kasper
533018f7d0 Update tests for BrowserStack (#6810)
Update tests to setup webdriver stuff in `jest-environment` and re-use one browser session instead of spawning one for each webdriver call to prevent creating too many BrowserStack sessions.
2019-03-29 16:05:53 +01:00
Joe Haddad
31f6f4c606
Ensure browser gets closed during testing (#6724)
* Ensure browser gets closed during testing

* Remove fit
2019-03-19 18:03:50 -04:00
JJ Kasper
87bd1c3b09
Add error handling for error being thrown in _app getinitialProps (#6680)
* Fix handling of undefined being thrown
in getInitialProps and update integration test

* Update test

* Move test to app-document
2019-03-17 11:43:03 -05:00
Joe Haddad
3ba18117f3 Pass all <Html> props to <html> (#6378)
* Pass along props to html

* Check for html props to be passed

* Switch ordering of html tag props

* Remove children from this.props
2019-02-21 00:42:53 +01:00
Connor Davis
fcf1167cd4 Upgrade standard and fix files (#6358)
Upgrades `standard` to major version 12
2019-02-19 22:45:07 +01:00
Giuseppe
5a4176cffe Invalidate cache for link[preload] in DEV (#6183)
Fixes #5860
2019-02-03 00:12:49 +00:00
Connor Davis
419bec0b9b Fix #5674 Append crossOrigin on the client side too, add config option for crossOrigin (#5873)
# Fixes https://github.com/zeit/next.js/issues/5674

This adds config option
```js
// next.config.js
module.exports = {
  crossOrigin: 'anonymous'
}
```
This config option is defined in the webpack Define Plugin at build.
`Head` and `NextScript` now use the config option, if it's not explicitly set on the element.
This value is now passed to Webpack so it can add it to scripts that it loads.
The value is now used in `PageLoader` (on the client) so it can add it to the scripts and links that it loads.
Using `<Head crossOrigin>` or `<NextScript crossOrigin>` is now deprecated.
2018-12-13 01:05:21 +01:00
Adam Lane
4ce095df89 Add crossOrigin via props to _document Head and NextScript (#5646)
This alternative implementation of https://github.com/zeit/next.js/pull/5150 follows @timneutkens suggestion of using props.

Fixes #5150 
Fixes #3630
2018-11-13 21:36:09 +01:00
Henrik Wenz
18488f47b0 Fix linter (#5350)
* Fix linter

* Add test env

* Fix lint errors
2018-10-20 17:00:01 +02:00
ǝlzlǝoq lǝᴉuɐp ツ
87f5df2454 Factor out NextScript inline source (#4934) (#4939)
This PR factors out the inline script into an own static method; fixes #4934.
2018-08-14 11:05:25 -07:00
Tim Neutkens
75476a9136
[WIP] Webpack 4, react-error-overlay, react-loadable (#4639)
Webpack 4, react-error-overlay, react-loadable (major)
2018-07-24 11:24:40 +02:00
Albin Ekblom
992ea2e875 Allow app component to be wrapped with custom enhancer when rendering (#4762)
* Add support for custom App and Component enhancers

* Add ctx.renderPage test

* Add tests for single enhancer function

* Cleanup renderPage options check

* Cleanup

* Add comment about backwards compatibility for renderPage

* Add more test cases
2018-07-13 11:22:45 +02:00
Thomas Hermann
1c817d2bbf Use nonce attribute for all scripts and preloads if provided (#4539)
When implementing a strict CSP with nonces and `strict-dynamic`, every script and preload requires a nonce.

https://csp.withgoogle.com/docs/strict-csp.html
2018-06-28 20:16:30 +02:00
Tim Neutkens
17e410a1d0
Fix Typescript HMR (#4689)
Fixes #4686

Adds tests for @zeit/next-typescript so that we don't regress on this again.

I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit.
2018-06-28 20:07:41 +02:00
Tim Neutkens
eca8e8f64b
Expose app.js (#4129)
* Expose pages/_app.js

* Add tests for _app and _document

* Uncomment deprecation warnings

* Add documentation for _app, improve documentation of _document

* Update docs / test for _document

* Add _document to client compiler in development

* Add missing app.js to comment

* Only warn once

* Add url-deprecated error page

* Combine tests

* Yse same message for all methods of ‘props.url’

* Update docs around _app

* Update documentation

* Quotes

* Update table of contents
2018-04-12 10:33:22 +02:00