1. 02 11月, 2019 5 次提交
    • T
      Call getInitialProps on Component when it’s not defined on App (#9287) · 21f0db81
      Tim Neutkens 提交于
      Fixes #9284
      21f0db81
    • J
      Polyfill `window.fetch` by Default (#9168) · ff2d3fd8
      Janicklas Ralph 提交于
      * 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
      ff2d3fd8
    • B
      fixed spelling of cookies (#9283) · 99755b67
      bennett4 提交于
      99755b67
    • J
      Disallow iSSG revalidation period of zero (#9280) · aef927d5
      Joe Haddad 提交于
      * Disallow iSSG revalidation period of zero
      
      * Fix revalidation period in test
      aef927d5
    • T
      Initial plugins implementation (#9139) · 7c80febc
      Tim Neutkens 提交于
      * 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
      7c80febc
  2. 01 11月, 2019 1 次提交
  3. 30 10月, 2019 3 次提交
  4. 29 10月, 2019 2 次提交
    • C
      Disable worker_threads by default for firebase compatibility (#9199) · 14ed8675
      Christoph Tavan 提交于
      * 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
      14ed8675
    • J
      Add warning for getStaticParams without getStaticProps (#9226) · 2d9f1991
      JJ Kasper 提交于
      * Add warning for getStaticParams without getStaticProps
      
      * Throw error instead of logging to make sure it's noticed
      
      * Lower default concurrency for tests
      2d9f1991
  5. 27 10月, 2019 2 次提交
  6. 26 10月, 2019 2 次提交
  7. 23 10月, 2019 1 次提交
  8. 18 10月, 2019 2 次提交
  9. 17 10月, 2019 1 次提交
  10. 16 10月, 2019 1 次提交
  11. 15 10月, 2019 1 次提交
  12. 11 10月, 2019 3 次提交
  13. 08 10月, 2019 1 次提交
  14. 06 10月, 2019 1 次提交
    • J
      De-experimentalize the `public/` folder (#8661) · e2d713f9
      JJ Kasper 提交于
      * Remove experimental.publicDirectory config
      
      * Error when public is set as an output dir
      
      * Remove experimental.publicDirectory checks
      
      * Update publicFiles checking in next build
      e2d713f9
  15. 05 10月, 2019 1 次提交
    • J
      Convert Dev Server to TypeScript (#8966) · e9b2e25c
      Joe Haddad 提交于
      * Convert Dev Server to TypeScript
      This converts the Next.js Development Server to TypeScript in prep for upcoming changes.
      
      * Convert remaining necessary
      
      * Fix some type errors
      
      * Adjust types
      e9b2e25c
  16. 04 10月, 2019 1 次提交
  17. 03 10月, 2019 1 次提交
  18. 02 10月, 2019 1 次提交
  19. 01 10月, 2019 1 次提交
  20. 30 9月, 2019 1 次提交
  21. 28 9月, 2019 3 次提交
    • J
      Add SPR Dynamic Routes to Manifest (#8885) · 296cfacd
      Joe Haddad 提交于
      * Add SPR Dynamic Routes to Manifest
      This adds dynamic routes for SPR pages to the prerender manifest so we can configure the Now Builder to handle these routes as SPR routes. Otherwise, they're treated like normal `getInitialProps` pages.
      
      * Fix types
      296cfacd
    • J
      Configure the Default Revalidate (#8880) · 2aa12031
      Joe Haddad 提交于
      * Configure the Default Revalidate
      The default revalidate behavior should be configured by Next.js. Otherwise, the behavior might drift or change in non-semver compliant ways between Next.js and the builder (or other 3rd party setups).
      
      * Add additional comment
      2aa12031
    • J
      Enforce natural numbers for SPR (#8882) · 01e54718
      Joe Haddad 提交于
      Per the HTTP specification, only natural numbers may be used for caching durations. We should enforce this with a really helpful error message.
      01e54718
  22. 27 9月, 2019 1 次提交
    • J
      Remove `stale-if-error` header from SPR (#8866) · e3d15f98
      Joe Haddad 提交于
      The Now CDN does not support the `stale-if-error` header and already behaves like that for `stale-while-revalidate`.
      
      Removing this header allows Now CDN to use its default headers instead of sending _only_ `stale-if-error` after stripping `s-maxage` and `stale-while-revalidate`.
      e3d15f98
  23. 25 9月, 2019 1 次提交
    • J
      SPR follow ups (#8846) · 2ae475e0
      JJ Kasper 提交于
      * Add revalidate header and error when invalid
      object from getStaticProps
      
      * Make sprCache no-op in dev mode
      
      * Update packages/next/next-server/server/next-server.ts
      
      * Update tests for fixes
      
      * Update getStaticProps error and add test
      
      * Update manifest test
      
      * Add validating revalidate value
      
      * Apply suggestions from code review
      Co-Authored-By: NJoe Haddad <joe.haddad@zeit.co>
      
      * Change from error to warning high revalidate value
      2ae475e0
  24. 24 9月, 2019 2 次提交
    • J
      Add `src` directory support (#8735) · a8e3b022
      JJ Kasper 提交于
      * Add find-pages-dir
      
      * Add support for src directory
      
      * Add test for pages dir preference
      
      * Update comment
      a8e3b022
    • J
      Add experimental SPR support (#8832) · 85e720a0
      JJ Kasper 提交于
      * initial commit for SPRv2
      
      * Add initial SPR cache handling
      
      * update SPR handling
      
      * Implement SPR handling in render
      
      * Update tests, handle caching with serverless next
      start, add TODOs, and update manifest generating
      
      * Handle no prerender-manifest from not being used
      
      * Fix url.parse error
      
      * Apply suggestions from code review
      Co-Authored-By: NJoe Haddad <joe.haddad@zeit.co>
      
      * Replace set with constants in next-page-config
      
      * simplify sprStatus.used
      
      * Add error if getStaticProps is used with getInitialProps
      
      * Remove stale TODO
      
      * Update revalidate values in SPR cache for non-seeded routes
      
      * Apply suggestions from code review
      
      * Remove concurrency type
      
      * Rename variable for clarity
      
      * Add copying prerender files during export
      
      * Add comment for clarity
      
      * Fix exporting
      
      * Update comment
      
      * Add additional note
      
      * Rename variable
      
      * Update to not re-export SPR pages from build
      
      * Hard navigate when fetching data fails
      
      * Remove default extension
      
      * Add brackets
      
      * Add checking output files to prerender tests
      
      * Adjust export move logic
      
      * Clarify behavior of export aggregation
      
      * Update variable names for clarity
      
      * Update tests
      
      * Add comment
      
      * s/an oxymoron/contradictory/
      
      * rename
      
      * Extract error case
      
      * Add tests for exporting SPR pages and update
      /_next/data endpoint to end with .json
      
      * Relocate variable
      
      * Adjust route building
      
      * Rename to unstable
      
      * Rename unstable_getStaticParams
      
      * Fix linting
      
      * Only add this when a data request
      
      * Update prerender data tests
      
      * s/isServerless/isLikeServerless/
      
      * Don't rely on query for `next start` in serverless mode
      
      * Rename var
      
      * Update renderedDuringBuild check
      
      * Add test for dynamic param with bracket
      
      * Fix serverless next start handling
      
      * remove todo
      
      * Adjust comment
      
      * Update calculateRevalidate
      
      * Remove cache logic from render.tsx
      
      * Remove extra imports
      
      * Move SPR cache logic to next-server
      
      * Remove old isDynamic prop
      
      * Add calling App getInitialProps for SPR pages
      
      * Update revalidate logic
      
      * Add isStale to SprCacheValue
      
      * Update headers for SPR
      
      * add awaiting pendingRevalidation
      
      * Dont return null for revalidation render
      
      * Adjust logic
      
      * Be sure to remove coalesced render
      
      * Fix data for serverless
      
      * Create a method coalescing utility
      
      * Remove TODO
      
      * Extract send payload helper
      
      * Wrap in-line
      
      * Move around some code
      
      * Add tests for de-duping and revalidating
      
      * Update prerender manifest test
      85e720a0
  25. 18 9月, 2019 1 次提交
    • J
      Global CSS Support (#8710) · 65358b7a
      Joe Haddad 提交于
      * Global CSS Support
      
      * Fix webpack configuration
      
      * oneOf rule isn't necessary yet
      
      * Adjust CSS chunk naming
      
      * Begin testing CSS behavior
      
      * Add another test TODO
      
      * Replace null-loader with ignore-loader
      
      * Turn on chunks for new CSS feature
      
      * Fix multi test suite
      
      * Test CSS import order
      
      * Test style HMR
      
      * Test CSS compilation
      
      * Test compilation and prefixing together
      
      * Verify CSS styling works for Development and Production
      
      * Add missing TODO
      
      * Remove unnecessary test
      
      * Adjust TODO message
      
      * Hide page until React hydrates
      
      * Revert "Hide page until React hydrates"
      
      This reverts commit 898d4e0ee547b003d5790e2b11476740d645b907.
      
      * Hide FOUC during development
      
      * Test CSS imports
      
      * Update tests TODO
      
      * Add fixture for url() test
      
      * Test `file-loader` support in CSS files
      
      * Use a simple variant of cssnano
      
      * Self-import
      
      * Undo bundling
      
      * Implement suggestion
      65358b7a