* Refactor SplitChunksPlugin configs and add experimental chunking strategy
* Use typeDefs for SplitChunksConfig
* Modify build manifest plugin to create runtime build manifest
* Add support for granular chunks to page-loader
* Ensure normal behavior if experimental granularChunks flag is false
* Update client build manifest to remove iife & implicit global
* Factor out '/_next/' prepending into getDependencies
* Update packages/next/build/webpack-config.ts filepath regex
Co-Authored-By: Jason Miller <developit@users.noreply.github.com>
* Simplify dependency load ordering in page-loader.js
* Use SHA1 hash to shorten filenames for dependency modules
* Add scheduler to framework cacheGroup in webpack-config
* Update page loader to not duplicate script tags with query parameters
* Ensure no slashes end up in the file hashes
* Add prop-types to framework chunk
* Fix issue with mis-attributed events
* Increase modern build size budget--possibly decrement after consulting with @janicklasralph
* Use module.rawRequest for lib chunks
Co-Authored-By: Daniel Stockman <daniel.stockman@gmail.com>
* Dasherize lib chunk names
Co-Authored-By: Daniel Stockman <daniel.stockman@gmail.com>
* Fix typescript errors, reorganize lib name logic
* Dasherize rawRequest, short circuit name logic when rawRequest found
* Add `scheduler` package to test regex
* Fix a nit
* Adjust build manifest plugin
* Shorten key name
* Extract createPreloadLink helper
* Extract getDependencies helper
* Move method
* Minimize diff
* Minimize diff x2
* Fix Array.from polyfill
* Simplify page loader code
* Remove async=false for script tags
* Code golf `getDependencies` implementation
* Require lib chunks be in node_modules
* Update packages/next/build/webpack-config.ts
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Replace remaining missed windows compat regex
* Trim client manifest
* Prevent duplicate link preload tags
* Revert size test changes
* Squash manifest size even further
* Add comment for clarity
* Code golfing 🏌️♂️
* Correctly select modern dependencies
* Ship separate modern client manifest when module/module enabled
* Update packages/next/build/webpack/plugins/build-manifest-plugin.ts
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Remove unneccessary filter from page-loader
* Add lookbehind to file extension regex in page-loader
* v9.0.3
* Update examples for Apollo with AppTree (#8180)
* Update examples for Apollo with AppTree
* Fix apolloClient being overwritten when rendering AppTree
* Golf page-loader (#8190)
* Remove lookbehind for module replacement
* Wait for build manifest promise before page load or prefetch
* Updating modern-only chunks inside the right entry point
* Fixing ts errors
* Rename variable
* Revert "Wait for build manifest promise before page load or prefetch"
This reverts commit c370528c6888ba7fa71162a0854534ed280224ef.
* Use proper typedef for webpack chunk
* Re-enable promisified client build manifest
* Fix bug in getDependencies map
* Insert check for granularChunks in page-loader
* Increase size limit temporarily for granular chunks
* Add 50ms delay to flaky test
* Set env.__NEXT_GRANULAR_CHUNKS in webpack config
* Reset size limit to 187
* Set process.env.__NEXT_GRANULAR_CHUNKS to false if selectivePageBuilding
* Update test/integration/production/test/index.test.js
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Do not create promise if not using chunking PR
* Add warning for bad href being passed to router
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Inline invalidHref for better code elimination
* Revert "Remove Old Prerender Implementation (#8218)"
This reverts commit 2ab300dd81.
* Add contentHandler for page config
* Rename config from contentHandler to re-use
experimentalPrerender
* Remove un-needed changes
* Replace backslashes for manifest
* Update manifest output format
* Make prerender: true enable SPR behavior and update
to merge prerender-manifest for flying-shuttle
* Fix output path for / prerender file
* Add dynamic routes to test suite
* Add generating and previewing of skeletons
for prerendered dynamic routes
* remove inline prerender option
* update to not replace getInitialProps which allows
nested getInitialProps and add query when fetching prerender
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Remove legacy prerender option
* Apply suggestions from review
* Apply more suggestions from review
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Add handling of error when parsing json
* Update handling of moving exported pages
* Rename nextPreviewSkeleton to _nextPreviewSkeleton
* bump
* Documentation about gzip
* Update packages/next/README.md
Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>
* Improve docs
* Update packages/next/README.md
Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
* Update packages/next/README.md
Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
* Update README.md
* Experimental: Serverless Trace target
The Serverless Trace target produces Serverless-handler wrapped entrypoints, but does not bundle all of `node_modules`.
This behavior increases bundling performance to be more akin to `target: 'server'`.
This mode is expected to be used with smart platforms (like [ZEIT Now](https://zeit.co/now) that can trace a program to its minimum dependencies.
* Use more generic variables
* Add asset relocator for production mode of serverless trace
* Verify Firebase compatiblity
* Revert "Add asset relocator for production mode of serverless trace"
This reverts commit 8404f1dcf28b60edab41a56c94b38dcd3fddec20.
* Add serverless trace tests
* Add _isLikeServerless helper
* Make constants
* Fix export
* Update packages/next-server/server/config.ts
Co-Authored-By: JJ Kasper <jj@jjsweb.site>
* Use a global helper for is like serverless
* Update import for isTargetLikeServerless
* Update packages/next/build/index.ts
Co-Authored-By: JJ Kasper <jj@jjsweb.site>
* Update CN README for consistency
* Add buttons to README.md
* Center nextjs learn text
* Update CN README for consistency
* fix README link in README-zh-CN.md
* Add error message for duplicate slug name within a dynamic path
* Update based on feedback
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
* WIP - committed with no-verify - progress
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
* Remove old test placeholder
* Add test for re-used names
* Provide AppContainer to getInitialProps for getDataFromTree
* Update to only pass AppTree component instead of AppContainer
* Clean up props and remove extra imports
* Make updates from review
* De-dupe AppTree a bit
* Re-use wrapApp in router
* Remove un-needed change
* revert changes to examples until on stable
* Add test for AppTree