1. 09 1月, 2019 3 次提交
    • T
      v8.0.0-canary.3 · a9f71e44
      Tim Neutkens 提交于
      a9f71e44
    • 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
    • P
      The current TypeScript "with-typescript" looks like it was put there as a... · 3a3347dc
      Peter Kellner 提交于
      The current TypeScript "with-typescript" looks like it was put there as a place holder. I'm fairly new to TypeScript but I'm sure the changes I've made here will be a huge improvement. Open to suggestions and to update as appropriate. Also, Tried to run yarn lint --fix to no avail. I can't figure out how to get it to find lint whether I'm running on my mac or PC. I tried lots of variations around npm i lint -g but had no success. (#6011)
      
      3a3347dc
  2. 07 1月, 2019 2 次提交
  3. 06 1月, 2019 2 次提交
    • T
      improve with-unstated example (#5998) · 5d8ae445
      tylim 提交于
      improve the example so that it can preserve unstated from server to client unstated
      5d8ae445
    • L
      Improve assets size (#5999) · ba95f754
      Luc 提交于
      It looks like :
      
      ```
      Pages sizes after gzip:
      
      ┌ / (196 B)
      ├ /_app (11.5 kB)
      ├ /_error (4.44 kB)
      ├ /blog (196 B)
      └ /blog/page (195 B)
      ```
      
      (style inspired from now-cli : https://github.com/zeit/now-cli/blob/canary/src/util/output/builds.js)
      
      I'll add dynamic chunks in a separate PR.
      
      @timneutkens Do you want to keep `_app` and `_error` or filter them out ? I think it's a good idea to keep them, because `_app` can get pretty large and it would encourage code splitting in that case.
      ba95f754
  4. 05 1月, 2019 4 次提交
    • J
      Test updater script on examples folder (#5993) · 7e12997a
      Juan Olvera 提交于
      I wrote a [script](https://github.com/j0lv3r4/dependency-version-updater) to update dependencies recursively in `package.json` files, e.g.:
      
      ```
      $ node index.js --path="./examples" --dependencies="react=^16.7.0,react-dom=^16.7.0"
      ```
      
      This PR contains the result against the examples folder.
      7e12997a
    • J
      Change React version of examples to latest (#5990) · 89a4cabb
      Juan Olvera 提交于
      I changed the version to the following files:
      
      - [x] - examples/with-next-css/package.json
      - [x] - examples/with-draft-js/package.json
      - [x] - examples/custom-server-polka/package.json
      - [x] - examples/with-cerebral/package.json
      - [x] - examples/with-zones/package.json
      - [x] - examples/with-universal-configuration-runtime/package.json
      - [x] - examples/with-apollo/package.json
      - [x] - examples/with-higher-order-component/package.json
      - [x] - examples/with-hashed-statics/package.json
      - [x] - examples/with-pkg/package.json
      - [x] - examples/with-jest/package.json
      - [x] - examples/with-glamorous/package.json
      - [x] - examples/with-custom-reverse-proxy/package.json
      - [ ] - examples/with-emotion/package.json
      - [x] - examples/with-styled-jsx-scss/package.json
      - [x] - examples/with-styled-jsx-plugins/package.json
      
      `with-emotion/package.json` already has the latest, so I guess it's other packabe. BUT I think we need to update this example with the latest version of `emotion` since it changed a little bit (for better).
      89a4cabb
    • L
      rename event-emitter.test.js -> mitt.test.js (#5992) · dd9d4cc5
      Luc 提交于
      dd9d4cc5
    • L
      Replace event-emitter.js by mitt (#5987) · fc19b233
      Luc 提交于
      This PR aims at replacing next-server/lib/event-emitter.js by mitt.
      
      Fix https://github.com/zeit/next.js/issues/4908
      
      event-emitter.js is ~400 bytes gzipped vs mitt is 200 bytes
      fc19b233
  5. 03 1月, 2019 3 次提交
  6. 02 1月, 2019 7 次提交
  7. 01 1月, 2019 6 次提交
  8. 31 12月, 2018 1 次提交
    • A
      Implement tslint for core files (#5952) · 20fe65ce
      Anderson Leite 提交于
      Fixes #5845 
      
      Implement tslint for core files
      
      **What is this?**
      Implements tslint for both next and next-server, but keeps standardjs/eslint for the .js files that are still there, we're gradually migrating to Typescript.
      
      **How does it work?**
      Before every commit (pre-commit) we execute the following `tslint` command:
      `tslint -c tslint.json 'packages/**/*.ts`
      
      **TSLint Rules**
      In order to avoid as much changes as possible I marked some rules as false. This way we can improve the linter but making sure this step will not break things. (see tslint.json)
      
      **Note**
      After merging this PR, you'll need to update your dependencies since it adds tslint to package.json
      20fe65ce
  9. 28 12月, 2018 2 次提交
    • T
      v7.0.2-canary.50 · aabc7201
      Tim Neutkens 提交于
      aabc7201
    • 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
  10. 27 12月, 2018 4 次提交
  11. 26 12月, 2018 1 次提交
  12. 24 12月, 2018 4 次提交
  13. 23 12月, 2018 1 次提交