1. 10 4月, 2019 2 次提交
  2. 07 4月, 2019 3 次提交
  3. 06 4月, 2019 1 次提交
  4. 05 4月, 2019 2 次提交
    • J
      Add ** experimental page globbing support (#6899) · cd9a1085
      Joe Haddad 提交于
      * Add ** page globbing support
      
      * Update check
      cd9a1085
    • J
      Make Client request BUILD_ID from the Server (#6891) · 19c63517
      Joe Haddad 提交于
      * Generate two versions of pages
      
      * Add code VSCode deleted
      
      * Add dynamicBuildId option to __NEXT_DATA__
      
      * Reduce amount of diff
      
      * Make getPageFile code easier to read
      
      * Minimize diff
      
      * minimize diff
      
      * Fix default value for dynamicBuildId
      
      * Fix weird bug
      
      * Fetch the head build id on client
      
      * Move __selectivePageBuilding
      
      * Add tests
      
      * Remove _this
      
      * Add console warning
      19c63517
  5. 04 4月, 2019 1 次提交
  6. 03 4月, 2019 2 次提交
  7. 28 3月, 2019 1 次提交
  8. 27 3月, 2019 1 次提交
    • J
      Specified page builds (#6796) · b835e258
      Joe Haddad 提交于
      * [wip] individual page builds
      
      * Make flag experimental and remove from main bin
      
      * Do not split chunks when using shared runtime
      b835e258
  9. 24 3月, 2019 1 次提交
  10. 17 3月, 2019 1 次提交
  11. 10 3月, 2019 1 次提交
  12. 01 3月, 2019 1 次提交
  13. 25 2月, 2019 1 次提交
    • C
      Remove glob package (#6415) · 5514949d
      Connor Davis 提交于
      We don't use a lot of the features of `glob`, so let's remove it in favor of a leaner approach using regex.
      
      It's failing on windows and I have no idea why and don't own a windows machine 🤦🏼‍♂️
      
      (Ignore some of the commits in here, I forgot to create the new branch before I started working)
      5514949d
  14. 21 2月, 2019 1 次提交
  15. 20 2月, 2019 1 次提交
  16. 17 2月, 2019 1 次提交
  17. 08 2月, 2019 1 次提交
  18. 26 1月, 2019 2 次提交
  19. 23 1月, 2019 1 次提交
  20. 11 1月, 2019 1 次提交
  21. 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
  22. 28 12月, 2018 1 次提交
    • T
      Serverless Next.js (#5927) · 0f23faf8
      Tim Neutkens 提交于
      **This does not change existing behavior.**
      
      building to serverless is completely opt-in.
      
      - Implements `target: 'serverless'` in `next.config.js`
      - Removes `next build --lambdas` (was only available on next@canary so far)
      
      This implements the concept of build targets. Currently there will be 2 build targets:
      
      - server (This is the target that already existed / the default, no changes here)
      - serverless (New target aimed at compiling pages to serverless handlers)
      
      The serverless target will output a single file per `page` in the `pages` directory:
      
      - `pages/index.js` => `.next/serverless/index.js`
      - `pages/about.js` => `.next/serverless/about.js`
      
      So what is inside `.next/serverless/about.js`? All the code needed to render that specific page. It has the Node.js `http.Server` request handler function signature:
      
      ```ts
      (req: http.IncomingMessage, res: http.ServerResponse) => void
      ```
      
      So how do you use it? Generally you **don't** want to use the below example, but for illustration purposes it's shown how the handler is called using a plain `http.Server`:
      
      ```js
      const http = require('http')
      // Note that `.default` is needed because the exported module is an esmodule
      const handler = require('./.next/serverless/about.js').default
      const server = new http.Server((req, res) => handler(req, res))
      server.listen(3000, () => console.log('Listening on http://localhost:3000'))
      ```
      
      Generally you'll upload this handler function to an external service like [Now v2](https://zeit.co/now-2), the `@now/next` builder will be updated to reflect these changes. This means that it'll be no longer neccesary for `@now/next` to do some of the guesswork in creating smaller handler functions. As Next.js will output the smallest possible serverless handler function automatically.
      
      The function has 0 dependencies so no node_modules are required to run it, and is generally very small. 45Kb zipped is the baseline, but I'm sure we can make it even smaller in the future.
      
      One important thing to note is that the function won't try to load `next.config.js`, so `publicRuntimeConfig` / `serverRuntimeConfig` are not supported. Reasons are outlined here: #5846
      
      So to summarize:
      
      - every page becomes a serverless function
      - the serverless function has 0 dependencies (they're all inlined)
      - "just" uses the `req` and `res` coming from Node.js
      - opt-in using `target: 'serverless'` in `next.config.js`
      - Does not load next.config.js when executing the function
      
      TODO:
      
      - [x] Compile next/dynamic / `import()` into the function file, so that no extra files have to be uploaded.
      - [x] Setting `assetPrefix` at build time for serverless target
      - [x] Support custom /_app
      - [x] Support custom /_document
      - [x] Support custom /_error
      - [x] Add `next.config.js` property for `target`
      
      Need discussion:
      - [ ] Since the serverless target won't support `publicRuntimeConfig` / `serverRuntimeConfig` as they're runtime values. I think we should support build-time env var replacement with webpack.DefinePlugin or similar.
      - [ ] Serving static files with the correct cache-control, as there is no static file serving in the serverless target
      0f23faf8
  23. 12 12月, 2018 1 次提交
  24. 03 12月, 2018 1 次提交