1. 19 1月, 2019 1 次提交
  2. 09 1月, 2019 1 次提交
    • T
      Replace pages-plugin with loader (#5994) · 9ffd23ee
      Tim Neutkens 提交于
      * Remove unused argument
      
      * Replace pages-plugin with loader
      
      * Add loader-utils types
      
      * Remove logs
      
      * Bring back previous deposal behavior
      
      * Remove console.log
      
      * Remove webpack/utils as it’s no longer in use
      
      * Remove hot-self-accept-loader
      
      * Error Recovery tests
      
      * Make hotSelfAccept a noop default loader
      
      * Fix windows deleted/added
      
      * Remove logging
      
      * Remove unused variables
      
      * Remove log
      
      * Simplify entrypoint generation
      
      * Don’t return the function
      
      * Fix _app test
      
      * Remove code that’s always true
      
      * Move aliases to constants
      
      * Use alias
      
      * Join pages alias in reduce
      
      * Default pages differently
      
      * Loop over pages instead of manually defining
      
      * Move entry generation into common function
      
      * Update packages/next/build/webpack/loaders/next-client-pages-loader.ts
      Co-Authored-By: Ntimneutkens <tim@timneutkens.nl>
      
      * Update packages/next/build/webpack/loaders/next-client-pages-loader.ts
      9ffd23ee
  3. 01 1月, 2019 1 次提交
  4. 16 12月, 2018 1 次提交
  5. 14 12月, 2018 1 次提交
    • J
      Implement websockets based on-demand-entries ping (#4508) · af07611a
      JJ Kasper 提交于
      Fixes #4495
      
      Here's my approach for replacing the XHR on-demand-entries pinger #1364 #4495. I'm not sure if this is the way everyone wants to accomplish this since I saw mention of using a separate server and port for the dynamic entries websocket, but thought this would be a fairly clean solution since it doesn't need that.
      
      With this method the only change when using a custom server is you have to listen for the upgrade event and pass it to next.getRequestHandler(). Example: 
      ```
      const server = app.listen(port)
      const handleRequest = next.getRequestHandler()
      
      if(dev) {
        server.on('upgrade', handleRequest)
      }
      ```
      af07611a
  6. 06 12月, 2018 1 次提交
  7. 03 12月, 2018 1 次提交
  8. 03 11月, 2018 1 次提交
  9. 29 10月, 2018 1 次提交
  10. 02 10月, 2018 1 次提交
  11. 01 10月, 2018 1 次提交
    • T
      Monorepo (#5341) · b1c4f3ae
      Tim Neutkens 提交于
      - Implements Lerna
      - Moves all source code into `packages/next`
      - Keeps integration tests in the root directory
      b1c4f3ae
  12. 16 9月, 2018 1 次提交
  13. 04 9月, 2018 1 次提交
    • N
      Fix HMR when parent directory starts with '.' (#4589) · 885eee80
      Nathaniel Hill 提交于
      @timneutkens 
      
      This simple change seems to work for me:
      
      ```
      const ignored = [
          '**/.*',
          'node_modules'
      ]
      ```
      
      I believe the regex is used here to try and work on windows as well. So, I wasted a bunch of time trying to figure out how to use a regex and/or the `path` module to ignore the parent directories until I noticed the following:
      
      > glob patterns are not filepaths. They are a type of regular language that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine.
      
      this is from the [anymatch](https://github.com/micromatch/anymatch) documentation which is what webpack uses accoring to this:
      
      https://webpack.js.org/configuration/watch/#watchoptions-ignored
      
      I've verified this glob pattern solves the problem in my environment, can someone test and verify that this works on windows?
      
      👍 
      885eee80
  14. 24 8月, 2018 1 次提交
  15. 25 7月, 2018 1 次提交
    • T
      Compile pages to .next/static directory (#4828) · 475b426e
      Tim Neutkens 提交于
      * Compile pages to .next/static/<buildid>/pages/<page>
      
      * Fix test
      
      * Export class instead of using exports
      
      * Use constant for static directory
      
      * Add comment about what the middleware does
      475b426e
  16. 24 7月, 2018 1 次提交
  17. 26 6月, 2018 1 次提交
  18. 15 6月, 2018 1 次提交
  19. 30 5月, 2018 1 次提交
  20. 16 5月, 2018 2 次提交
  21. 28 3月, 2018 1 次提交
  22. 14 2月, 2018 2 次提交
    • T
      Make pageExtensions configurable (#3787) · 903f15ac
      Tim Neutkens 提交于
      * Make page require faster
      
      * Add windows search/replace
      
      * Use normalize instead of resolve
      
      * Add remaining tests
      
      * Use sep instead of /
      
      * Add test files
      
      * Make component require faster
      
      * Add console.error
      
      * Make pageExtensions configurable
      
      * Remove resolve.js
      
      * Add test for `.jsx`
      
      * Also resolve `/nav/index` and the likes
      
      * Normalize page paths
      
      * Use config passed off by webpack
      903f15ac
    • T
      Get config from one location (#3801) · 64379ee3
      Tim Neutkens 提交于
      * Remove obsolete clean.js
      
      * Remove unused root-module-relative-path
      
      * Single source of configuration
      
      * Fix next export
      64379ee3
  23. 30 1月, 2018 1 次提交
    • T
      Universal Webpack (#3578) · e093441b
      Tim Neutkens 提交于
      * Speed up next build
      
      * Document webpack config
      
      * Speed up next build
      
      * Remove comment
      
      * Add comment
      
      * Clean up rules
      
      * Add comments
      
      * Run in parallel
      
      * Push plugins seperately
      
      * Create a new chunk for react
      
      * Don’t uglify react since it’s already uglified. Move react to commons in development
      
      * Use the minified version directly
      
      * Re-add globpattern
      
      * Move loaders into a separate variable
      
      * Add comment linking to Dan’s explanation
      
      * Remove dot
      
      * Add universal webpack
      
      * Initial dev support
      
      * Fix linting
      
      * Add changes from Arunoda's work
      
      * Made next dev works.
      But super slow and no HMR support.
      
      * Fix client side hot reload
      
      * Server side hmr
      
      * Only in dev
      
      * Add on-demand-entries client + hot-middleware
      
      * Add .babelrc support
      
      * Speed up on demand entries by running in parallel
      
      * Serve static generated files
      
      * Add missing config in dev
      
      * Add sass support
      
      * Add support for .map
      
      * Add cssloader config and fix .jsx support
      
      * Rename
      
      * use same defaults as css-loader. Fix linting
      
      * Add NoEmitErrorsPlugin
      
      * Add clientBootstrap
      
      * Use webpackhotmiddleware on the multi compiler
      
      * alpha.3
      
      * Use babel 16.2.x
      
      * Fix reloading after error
      
      * Remove comment
      
      * Release 5.0.0-univeral-alpha.1
      
      * Remove check for React 16
      
      * Release 5.0.0-universal-alpha.2
      
      * React hot loader v4
      
      * Use our static file rendering machanism to serve pages.
      This should work well since the file path for a page is predictable.
      
      * Release 5.0.0-universal-alpha.3
      
      * Remove optional loaders
      
      * Release 5.0.0-universal-alpha.4
      
      * Remove clientBootstrap
      
      * Remove renderScript
      
      * Make sure pages bundles are served correctly
      
      * Remove unused import
      
      * Revert to using the same code as canary
      
      * Fix hot loader
      
      * Release 5.0.0-universal-alpha.5
      
      * Check if externals dir exist before applying config
      
      * Add typescript support
      
      * Add support for transpiling certain packages in node_modules
      
      Thanks to @giuseppeg’s work in https://github.com/zeit/next.js/pull/3319
      
      * Add BABEL_DISABLE_CACHE support
      
      * Make sourcemaps in production opt-in
      
      * Revert "Add support for transpiling certain packages in node_modules"
      
      This reverts commit d4b1d9babfb4b9ed4f4b12d56d52dee233e862da.
      
      In favor of a better api around this.
      
      * Support typescript through next.config.js
      
      * Remove comments
      
      * Bring back commons.js calculation
      
      * Remove unused dependencies
      
      * Move base.config.js to webpack.js
      
      * Make sure to only invalidate webpackDevMiddleware one after other.
      
      * Allow babel-loder caching by default.
      
      * Add comment about preact support
      
      * Bring back buildir replace
      
      * Remove obsolete plugin
      
      * Remove build replace, speed up build
      
      * Resolve page entries like pages/day/index.js to pages/day.js
      
      * Add componentDidCatch back
      
      * Compile to bundles
      
      * Use config.distDir everywhere
      
      * Make sure the file is an array
      
      * Remove console.log
      
      * Apply optimization to uglifyjs
      
      * Add comment pointing to source
      
      * Create entries the same way in dev and production
      
      * Remove unused and broken pagesGlobPattern
      
      * day/index.js is automatically turned into day.js at build time
      
      * Remove poweredByHeader option
      
      * Load pages with the correct path.
      
      * Release 5.0.0-universal-alpha.6
      
      * Make sure react-dom/server can be overwritten by module-alias
      
      * Only add react-hot-loader babel plugin in dev
      
      * Release 5.0.0-universal-alpha.7
      
      * Revert tests
      
      * Release 5.0.0-universal-alpha.10
      
      * Make sure next/head is working properly.
      
      * Add wepack alias for 'next' back.
      
      * Make sure overriding className in next/head works
      
      * Alias react too
      
      * Add missing r
      
      * Fragment fallback has to wrap the children
      
      * Use min.js
      
      * Remove css.js
      
      * Remove wallaby.js
      
      * Release 5.0.0-universal-alpha.11
      
      * Resolve relative to workdir instead of next
      
      * Make sure we touch the right file
      
      * Resolve next modules
      
      * Remove dotjsx removal plugins since we use webpack on the server
      
      * Revert "Resolve relative to workdir instead of next"
      
      This reverts commit a13f3e4ab565df9e2c9a3dfc8eb4009c0c2e02ed.
      
      * Externalize any locally loaded module lives outside of app dir.
      
      * Remove server aliases
      
      * Check node_modules reliably
      
      * Add symlink to next for tests
      
      * Make sure dynamic imports work locally.
      This is why we need it: https://github.com/webpack/webpack/blob/b545b519b2024e3f8be3041385bd326bf5d24449/lib/MainTemplate.js#L68
      We need to have the finally clause in the above in __webpack_require__.
      webpack output option strictModuleExceptionHandling does that.
      
      * dynmaic -> dynamic
      
      * Remove webpack-node-externals
      
      * Make sure dynamic imports support SSR.
      
      * Remove css support in favor of next-css
      
      * Make sure we load path from `/` since it’s included in the path matching
      
      * Catch when ensurepage couldn’t be fulfilled for `.js.map`
      
      * Register require cache flusher for both client and server
      
      * Add comment explaining this is to facilitate hot reloading
      
      * Only load module when needed
      
      * Remove unused modules
      
      * Release 5.0.0-universal-alpha.12
      
      * Only log the `found babel` message once
      
      * Make sure ondemand entries working correctly.
      Now we are just using a single instance of OnDemandEntryHandler.
      
      * Better sourcemaps
      
      * Release 5.0.0-universal-alpha.13
      
      * Lock uglify version to 1.1.6
      
      * Release 5.0.0-universal-alpha.14
      
      * Fix a typo.
      
      * Introduce multi-zones support for mircofrontends
      
      * Add section on css
      e093441b
  24. 28 12月, 2017 1 次提交
    • A
      Remove buildId from dynamic import URLs (#3498) · 337fb6a9
      Arunoda Susiripala 提交于
      * Use without .js for the filename.
      
      * Modify the chunk filename to add .js via webpack
      
      * Add import chunk's hash to the filename via webpack.
      
      * Remove buildId from dynamic import urls.
      
      * Make sure next-export work with dynamic imports
      337fb6a9
  25. 31 8月, 2017 1 次提交
  26. 30 6月, 2017 1 次提交
  27. 07 6月, 2017 1 次提交
    • A
      [WIP] Reload webpack if needed (#2076) · 937d0e2b
      Arunoda Susiripala 提交于
      * Reload webpack via hot-reloader when needed.
      We need to do this specially we removed a previosly
      built page from the filesystem.
      
      * Make sure reloading is happen only once
      
      * Reload only if there's a missing page error.
      
      * Remove debug logs.
      
      * 2.4.2
      
      * Refactor the codebase a bit.
      
      * Move some commonly used regexp to a utils module.
      
      * Handle the reloading well when there's a custom error page.
      
      * Add a HMR test case.
      
      * Close the browser in the test case.
      937d0e2b
  28. 05 6月, 2017 2 次提交
  29. 31 5月, 2017 1 次提交
  30. 14 5月, 2017 1 次提交
  31. 18 4月, 2017 1 次提交
    • A
      Add CDN support with assetPrefix (#1700) · dec85fe6
      Arunoda Susiripala 提交于
      * Introduce script tag based page loading system.
      
      * Call ensurePage only in the dev mode.
      
      * Implement router using the page-loader.
      
      * Fix a typo and remove unwanted code.
      
      * Fix some issues related to rendering.
      
      * Fix production tests.
      
      * Fix ondemand test cases.
      
      * Fix unit tests.
      
      * Get rid of eval completely.
      
      * Remove all the inline code.
      
      * Remove the json-pages plugin.
      
      * Rename NEXT_PAGE_LOADER into __NEXT_PAGE_LOADER__
      
      * Rename NEXT_LOADED_PAGES into __NEXT_LOADED_PAGES__
      
      * Remove some unwanted code.
      
      * Load everything async.
      
      * Remove lib/eval-script.js
      We no longer need it.
      
      * Move webpack idle wait code to the page-loader.
      Because that's the place to do it.
      
      * Remove pageNotFound key from the error.
      
      * Remove unused error field 'buildError'
      
      * Add much better logic to normalize routes.
      
      * Get rid of mitt.
      
      * Introduce a better way to register pages.
      
      * Came back to the mitt() based page-loader.
      
      * Add link rel=preload support.
      
      * Add assetPrefix support to add support for CDNs.
      
      * Add assetPrefix support for preload links.
      
      * Update readme.md
      dec85fe6
  32. 08 4月, 2017 1 次提交
  33. 06 4月, 2017 1 次提交
  34. 28 2月, 2017 2 次提交
  35. 27 2月, 2017 1 次提交
    • A
      Implement "on demand entries" (#1111) · d3b1ead1
      Arunoda Susiripala 提交于
      * Add a plan for dynamic entry middleware.
      
      * Use dynamic pages middleware to load pages in dev.
      
      * Add the first version of middleware but not tested.
      
      * Integrated.
      
      * Disable prefetching in development.
      Otherwise it'll discard the use of dynamic-entries.
      
      * Build custom document and error always.
      
      * Refactor code base.
      
      * Change branding as on-demand entries.
      
      * Fix tests.
      
      * Add a client side pinger for on-demand-entries.
      
      * Dispose inactive entries.
      
      * Add proper logs.
      
      * Update grammer changes.
      
      * Add integration tests for ondemand entries.
      
      * Improve ondemand entry disposing logic.
      
      * Try to improve testing.
      
      *  Make sure entries are not getting disposed in basic integration tests.
      
      * Resolve conflicts.
      
      * Fix tests.
      
      * Fix issue when running Router.onRouteChangeComplete
      
      * Simplify state management.
      
      * Make sure we don't dispose the last active page.
      
      * Reload invalid pages detected with the client side ping.
      
      * Improve the pinger code.
      
      * Touch the first page to speed up the future rebuild times.
      
      * Add Websockets based pinger.
      
      * Revert "Add Websockets based pinger."
      
      This reverts commit f706a49a3d886d0231259b7a1fded750ced2e48f.
      
      * Do not send requests per every route change.
      
      * Make sure we are completing the middleware request always.
      
      * Make sure test pages are prebuilt.
      d3b1ead1
  36. 15 2月, 2017 1 次提交