* Use Cached SSG Data on History Navigation
* Add data caching test
* Create a static data cache
* Eliminate an if / return
* Do not cache in dev mode
* bump
* bump
* bump
* bump
Co-authored-by: JJ Kasper <jj@jjsweb.site>
* Expose CSS Issuer When Error
This introduces a friendlier error for invalid CSS imports by telling you the offending file.
---
Fixes#9847
* fix test matches
* Migrate from wd to selenium-webdriver
* Add chaining for next-webdriver
* Re-add browserStackLocal global for teardown
* Add additional element methods
* Use freshWindow helper for chrome
* Add selenium-server
* Add cross-env for windows compat
* Fix single quote windows
* Update production preload tests
* Update preload tests count
* Update CircleCi for testing other browsers
* Update CI configs
* Update config
* Add browser.url command
* Add more methods
* Update xcode version
* Make sure to add chromedriver to path
* Add forceExit flag
* Update config
* Update config
* Disable safari
* Fix bug in test
* Add teardown logging
* Update jest teardown
* Move testing ie11 to Azure
* Update job names
* Remove force exiting on long teardown
* Update Azure config
* Re-add safari testing with BrowserStack
* Update config
* Update prefetch tests for ie11
* Update prefetch for safari and ids for ie11 testing
* trigger prefetching manually in ie
* Optimize Prefetching
* fix css client nav test
* fix preload viewport test
* fix production test
* patch tests more
* Make page loader wait on prefetch
* no unhandled rejection
* Save some bytes
* Add check: true behavior to custom routes
* Update adding dev routes
* Add checking of pages and dynamic routes for check: true
* Fix hasPage binding
* Add tests for check: true behavior
* Update regex checking
* Make changes based on review
* Update to handle rewrites in serverless loader
* Update to not change req.url
* Make sure to always parse dynamic route params
* Export all of pathToRegexp from path-match
Co-authored-by: Joe Haddad <timer150@gmail.com>
* CSS Module Support
* Fix Server-Side Render of CSS Modules
* Fix Jest Snapshots
https://github.com/facebook/jest/pull/8492
* Fix snapshots
* Add test for CSS module edit without remounting
* Add tests for dev and production style being applied
* Add missing TODOs
* Include/exclude should only be applied to issuer, not the CSS file itself
* Add CSS modules + node_modules tests
* Test that content is correct
* Create Multi Module Suite
* Add client-side navigation support for CSS
* Add tests for client-side nav
* Add some delays
* Try another fix
* Increase timeout to 3 minutes
* Fix test
* Give all unique directories
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update import
* Adding native-url package
* Bumping native-url version
* Upgrading native-url
* Logging stats object for debugging
* Logging stats object for debugging
* Adding try catch to the error lines
* Experimenting with regex
* Experimenting with regex
* Experimenting with regex
* Testing regex changes
* Fixing defer-script test case to not include polyfill.js
* Meging changes with existing polyfill work
* Bumping version
* adjust webpack config
* Reduce size in size test
* Remove 1kb from legacy
* Bumping native-url version, includes fix for IE11
* Update lock file
* Updating native-url, fixes issue on IE11
* Fix sourcemap being added in document
* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled
* Fix typescript error
* WIP: rename get static paths
* Adjust logic
* Add warning
* rename constant
* Check for error when using old method
* Add friendly error message
* Test for message of invalid keys
* replace index with dots
* Adding native-url package
* Bumping native-url version
* Upgrading native-url
* Logging stats object for debugging
* Logging stats object for debugging
* Adding try catch to the error lines
* Experimenting with regex
* Experimenting with regex
* Experimenting with regex
* Testing regex changes
* Fixing defer-script test case to not include polyfill.js
* Meging changes with existing polyfill work
* Bumping version
* adjust webpack config
* Reduce size in size test
* Remove 1kb from legacy
* Disable concurrency for tests
* Add browser instance sharing
* Bump concurrency and install chromedriver smoother
* Fix config typo
* Fix local test
* Limit azure concurrency again
* Add delay for empty-object-test
* Make sure to use open port for chromedriver
* Move browser closing to jest-environment
* Re-enable concurrency for Azure
* bump
* Disable concurrency for Azure again
* Re-enable concurrency for Azure
* bump
* Drop Re-Exported iSSG Imports
This pull request adds loader support for the following export form:
```js
export { getStaticParams as unstable_getStaticParams } from '../../lib/docs/page';
export { getStaticProps as unstable_getStaticProps } from '../../lib/docs/page';
```
This will now result in correct detection and removal.
* Add unit tests for next page config behavior
* Test extra function is not dropped
* Fix next-news inconsistent return type
* Add failing test for static file rewrite
* Revert "Fix next-news inconsistent return type"
This reverts commit b66e76fb86061e45741c3c4bb9296a0874900f76.
* Add failing test for double redirect
* Fix bug in matcher when having multiple redirects
* Remove custom traversal in favor of router handling it
* Update next-server.ts
* Update router.ts
* Temporarily disable test
* Don't deeply resolve redirects
* Support combined parameters + query passing
* Make sure params are correctly passed in
* Add test for hash in route
* Catch-all Route Support
* Add SSR tests
* Add additional test
* Add unit tests
* Put the feature behind a flag
* Apply suggestions from code review
Co-Authored-By: JJ Kasper <jj@jjsweb.site>
* Fix test
* Polyfilling fetch and object-assign
* Polyfilling corejs object-assign
* Adding object-assign in polyfills.js. IE11 does not support Object.assign
* Fixing failing test
* Updating object.assign polyfill to fix aliasing
* Updating test case value to match new build stats
* Increasing the size of default build to 225kb
* Fixing defer-script test case to not include polyfill.js
* Revert README.md
* Re-design the polyfill approach based on PR feedback
* Adding comment and fixing test case
* Rename polyfills chunk
* Extract aliases into helper
* Remove extra new line
* Fix TypeScript typings
* Adding _internal_fetch alias
* Adjust build manifest plugin
* Build manifest plugin changes - adding a separate entry for polyfills
* Rename polyfills entry in build-manifest.json
* Remove old comment
* Fix TS
* Set key
* Polyfills already added
* Filtring polyfill.module.js
* Fix test
* Add __internal_fetch to alias rule
* Adjust name
* bump size
* ignore polyfills
* sigh
* Aliasing Object.assign
* Mergin latest changes
* Integration test for polyfilling fetch
* Remove comment
* Fix prettier error
* Fix review comments
* Fix review comments
* Update fetch.js
* Fix tests
* Initialize Git repo on app creation
This PR initializes a Git repository after Create Next App runs.
We ensure the app was not created in an already-existing Git or Mercurial repo.
Failures of setup (no Git installed) do not fail the application bootstrapping.
Closes#9077 (replaces)
* Add test
* Update index.test.js
* Test custom-routes serverless
* Make sure we add default statusCode to routes-manifest
* Update routes-manifest
* Add DEFAULT_REDIRECT_STATUS constant
* add initial custom-routes handling
* Add tests for custom-routes
* Handle chained redirects, separate dev custom
routes reading, and add version to routes manifest
* Handle no routes manifest
* Swap build custom routes calling
* Add flatten-routes
* Add flattening of custom routes
* Re-work implementation to follow routes top-down
* Add regex field to routes-manifest
* Fix path-to-regexp match breaking after upgrade
* Fix duplicate const from merge
* Add some changes from review
* Don't make path-match strict
* add default custom route values
* Update routes-manifest
* Update options for path-match
* Remove todo
* Add test for rewrite with params
* Only use strict mode for custom routes
* Update dynamic-routing test
* Move getCustomRoutes to prepare
* Remove extra change
* Update handling for error-in-error test
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Apply suggestions from review
* Update slice change
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Apply suggestions from review
* Fix TypeScript error
* Fix getCustomRoutes in dev mode
* Apply suggestions from code review
* Update slice
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Delete un-used test page
* Add test for param overwriting
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Add extra check to param test
* Polyfilling fetch and object-assign
* Polyfilling corejs object-assign
* Adding object-assign in polyfills.js. IE11 does not support Object.assign
* Fixing failing test
* Updating object.assign polyfill to fix aliasing
* Updating test case value to match new build stats
* Increasing the size of default build to 225kb
* Fixing defer-script test case to not include polyfill.js
* Revert README.md
* Re-design the polyfill approach based on PR feedback
* Adding comment and fixing test case
* Rename polyfills chunk
* Extract aliases into helper
* Remove extra new line
* Fix TypeScript typings
* Adding _internal_fetch alias
* Adjust build manifest plugin
* Build manifest plugin changes - adding a separate entry for polyfills
* Rename polyfills entry in build-manifest.json
* Remove old comment
* Fix TS
* Set key
* Polyfills already added
* Filtring polyfill.module.js
* Fix test
* Add __internal_fetch to alias rule
* Adjust name
* bump size
* ignore polyfills
* sigh
* Add initial bit for plugins
* Add checks for needed metadata values
* Add test
* Initial plugins changes
* Add handling for _app middleware
* Add loading of _document middleware and
handling of multiple default export syntaxes
* Fix insert order for middleware member expression
* Remove early return from middleware plugin from testing
* Add tests for current plugin middlewares
* Update test plugin package.json
* Update handling for class default export
* Update to use webpack loader instead of babel
plugin, remove redundant middleware naming, and add field for required env for plugins
* Add middleware to support material-ui use case
and example material-ui plugin
* Update tests and remove tests stuff from google analytics plugin
* Remove old plugin suite
* Add init-server middleware
* Exit hard without stack trace when error in collecting plugins
* Add on-error-client and on-error-server and update
to run init-server with next-start in serverless mode
* Update init-client for google analytics plugin
* Add example Sentry plugin and update with-sentry-simple
* Remove middleware field/folder and use src dir for plugins
* Add post-hydration middleware and update
material-ui plugin
* Put plugins code behind flag
* Update chromedriver
* Revert "Update chromedriver"
This reverts commit 1461e978e677f7da05e29e0415ec614a04bf65f9.
* Update lock file
* Remove un-needed _app for sentry example
* Add auto loading of scoped packages, add plugins
config for manually listing plugins, and update
to only collect plugins once
* Update example plugins
* Expose plugins' config
* Rename plugin lifecycles and add babel-preset-build
* Rename other methods with unstable
* Update log when plugin config overrides auto-detecting
* Throw Error for next.config.ts
Ref: https://github.com/zeit/next-plugins/issues/555
* Check for .js else .ts
* Update Error Message
Co-Authored-By: Alexander Kachkaev <alexander@kachkaev.ru>
* Add test case when both next.config.js and next.config.ts exist.
* Remove extra constant CONFIG_FILE_TS and Add check for ts/tsx/json
* Rename test config parameter and add tsx and json files
* Change messege
* change value
* Update next.config.json
* Update next.config.json
* Change message and add jsx filter
* Adjust
* Simplify test
* adjust
* Enable granular chunks config for all chunk types
Adding comment
Bug fix
* Update index.test.js
* Update index.test.js
* Fix test cases. Adding next/link to not trigger a different bug
* Removing obsolete comment
* Pass config.experimental.cpus to export during build
Currently, there is no way of specifying the number of worker threads of
`next export` when run as part of `next build`.
I suggest a sane default should be to just use the same amount of
workers that were used during the build process which currently seems to
be configured through `config.experimental.cpus`.
This setting is already respected in the two other places where
jest-workers are in use: The TerserPlugin and the staticCheckWorkers in
`next build`.
* Only enable worker threads if there is more than 1 worker
Multiple worker threads can cause problems when certain dependencies are
being used, see e.g. https://github.com/zeit/next.js/issues/7894
This patch allows disabling of worker threads by setting
`config.experimental.cpus = 1`.
The benefit of spawning 1 worker thread, if there is any at all, should
very limited anyways, so the workload can just as well be processed in
the main thread.
* Disable parallel build for firebase authentication example
* Add integration test to cover #7894
* Rename test suite and add worker_threads config
* Disable worker_threads by default
* Update index.test.js
* Use workerThreads config for TerserPlugin
* Update to use workerThreads config in
TerserPlugin for consistency
* Disable node 12 specific test
* Add a configuration flag to disable integrated type checker
* Add tests for typescript-transpileonly
* Restore removed argument
* Make output more coherent
* Split transpileOnly into ignoreDevErrors and ignoreBuildErrors
* Minor stylistic change
* Add warning for getStaticParams without getStaticProps
* Throw error instead of logging to make sure it's noticed
* Lower default concurrency for tests
* allow NextScript to optionally defer javascript
* move defer options to experimental feature
* combine defer flags into a single option
* Update deferScripts to work with serverless target
* Add test for defer and async property
* Read the async property
* Check versions of chrome and chromedriver
* Update to chromedriver 76
* Fix test
* Ensure directory before flushing cache iSSG file
* Add test for prerender cache flush
* Nest the dynamic route test one more level
* update fetch for test
* Update error check
* Add tracking src dir usage to telemetry
* Move isSrcDir back to eventVersion
* Move spinner back
* Add test for isSrcDir telemetry
* Add test for dev mode