1. 31 3月, 2020 14 次提交
  2. 26 3月, 2020 1 次提交
    • J
      Add initial support for new env handling (#10525) · d8155b22
      JJ Kasper 提交于
      * Add initial support for new env config file
      
      * Fix serverless processEnv call when no env is provided
      
      * Add missing await for test method
      
      * Update env config to .env.json and add dotenv loading
      
      * ncc dotenv package
      
      * Update type
      
      * Update with new discussed behavior removing .env.json
      
      * Update hot-reloader createEntrypoints
      
      * Make sure .env is loaded before next.config.js
      
      * Add tests for all separate .env files
      
      * Remove comments
      
      * Add override tests
      
      * Add test for overriding env vars based on local environment
      
      * Add support for .env.test
      
      * Apply suggestions from code review
      Co-Authored-By: NJoe Haddad <joe.haddad@zeit.co>
      
      * Use chalk for env loaded message
      
      * Remove constant as it’s not needed
      
      * Update test
      
      * Update errsh, taskr, and CNA template ignores
      
      * Make sure to only consider undefined missing
      
      * Remove old .env ignore
      
      * Update to not populate process.env with loaded env
      
      * Add experimental flag and add loading of global env values
      Co-authored-by: NTim Neutkens <timneutkens@me.com>
      Co-authored-by: NJoe Haddad <joe.haddad@zeit.co>
      d8155b22
  3. 18 2月, 2020 1 次提交
    • J
      Remove ts-ignore where possible (#10541) · 3f691eaa
      Jan Potoms 提交于
      * Remove ts-ignore where possible
      
      And replace by typecasts
      
      * More accurate types
      
      * bend cliententries in a correct shape earlier on
      
      * comment becomes unnecessary
      
      * add webpack overload to allow for the next.js use case
      
      * Avoid changing public interface
      Co-authored-by: NJoe Haddad <timer150@gmail.com>
      3f691eaa
  4. 08 1月, 2020 1 次提交
  5. 11 11月, 2019 1 次提交
  6. 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
  7. 19 9月, 2019 1 次提交
    • J
      Reduce Install Size (#8788) · b4d349e6
      Joe Haddad 提交于
      * Reduce Install Size
      This should shave a decent amount off our install size.
      
      * Fix CSS source map emitting
      
      * Fix generation
      
      * Enable source maps for testing purposes
      
      * Disable double comment
      
      * Fix test regex
      b4d349e6
  8. 04 9月, 2019 1 次提交
    • T
      Move next-server back into `next` package (#8613) · 2ba352da
      Tim Neutkens 提交于
      * Initial move
      
      * Make emitting work
      
      * Update paths
      
      * Remove leftover files
      
      * Add correct externals configuration
      
      * Import correct path
      
      * Update path to work with ts-server test
      
      * Update lib directory
      
      * Compile next-server/lib
      2ba352da
  9. 30 8月, 2019 1 次提交
    • J
      Anonymous Telemetry (#8529) · 1f4e34ca
      Joe Haddad 提交于
      * Add anonymous telemetry
      
      * Fix types
      
      * Remove semver package
      
      * Rename build time variable
      
      * Track CSS-in-JS solutions
      
      * Single retry and 5s timeout
      1f4e34ca
  10. 24 6月, 2019 1 次提交
  11. 22 6月, 2019 1 次提交
    • G
      ncc Webpack build redux (#7628) · e85a517e
      Guy Bedford 提交于
      * Reimplement ncc webpack build
      
      This reverts commit 6feca310.
      
      * Shared webpack build
      
      * ncc workaround pending @zeit/ncc#437
      
      * update ncc
      
      * build tweaks, fixup autodll-import
      
      * possible Node 8 fix
      
      * second possible Node 8 fix
      
      * and update taskfile
      e85a517e
  12. 29 5月, 2019 1 次提交
    • T
      Move syntax formatting to prettier (#7454) · 3e51ddb8
      Tim Neutkens 提交于
      * Run prettier over packages/**/*.js
      
      * Run prettier over packages/**/*.ts
      
      * Run prettier over examples
      
      * Remove tslint
      
      * Run prettier over examples
      
      * Run prettier over all markdown files
      
      * Run prettier over json files
      3e51ddb8
  13. 17 5月, 2019 2 次提交
  14. 29 4月, 2019 1 次提交
  15. 27 4月, 2019 1 次提交
  16. 25 4月, 2019 1 次提交
  17. 24 4月, 2019 2 次提交
  18. 23 4月, 2019 1 次提交
    • L
      Add more TypeScript types (#7054) · 29f71bfc
      Luis Fernando Alvarez D 提交于
      * Moved server/lib/utils.js to Typescript
      
      * moved _app.js to Typescript
      
      * Moved _error.js to Typescript
      
      * Added argument for custom props in _app and _error
      
      * Moved _document.js to Typescript
      
      * updated one test
      
      * Updated types and added a validation for _document props
      
      * Improved types
      
      * Fixed some types
      
      * Updated AppType
      
      * Fixed some tests
      
      * Added missing import
      
      * Removed a not very useful type
      
      * Fix missing type
      
      * Move @types/styled-jsx
      
      * Fix typescript errors
      29f71bfc
  19. 16 4月, 2019 1 次提交
  20. 02 4月, 2019 1 次提交
  21. 25 3月, 2019 1 次提交
  22. 24 3月, 2019 1 次提交
  23. 21 2月, 2019 1 次提交
  24. 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
  25. 16 12月, 2018 1 次提交
    • D
      add --node-args option (#5858) · ebf217cb
      DevSide 提交于
      This message is from @timneutkens after making changes:
      - Convert executables to Typescript
      - Remove `minimist` in favor of `arg` 
      - Implement `--node-args` usage: `--node-args="--throw-deprecation"`
      - Adds tests for usage of the `next` cli
      ebf217cb