- 09 1月, 2019 2 次提交
-
-
由 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
-
由 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)
-
- 07 1月, 2019 2 次提交
-
-
由 Zack Tanner 提交于
Enables SSR for styled-components babel-plugin to prevent HTML attribute mismatch warnings during rehydration.
-
由 Zack Tanner 提交于
-
- 06 1月, 2019 2 次提交
-
-
由 tylim 提交于
improve the example so that it can preserve unstated from server to client unstated
-
由 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.
-
- 05 1月, 2019 4 次提交
-
-
由 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.
-
由 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).
-
由 Luc 提交于
-
由 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
-
- 03 1月, 2019 3 次提交
-
-
由 iceRao 提交于
* add readme * 修改中文文档,如中英文空格 * Update README-zh-CN.md 当前翻译版本为 7.0.0-canary.8 * anchor bugfix
-
由 Dima 提交于
-
由 Kévin Dunglas 提交于
-
- 02 1月, 2019 7 次提交
-
-
由 Tim Neutkens 提交于
-
由 Niklas Wagner 提交于
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
Extends on #5927, instead of `.default` we'll expose `.render` which is semantically more correct / mirrors the naming of the custom server API. I've updated the spec in #5927 to reflect this change. (copied from #5927): ```js const http = require('http') const page = require('./.next/serverless/about.js') const server = new http.Server((req, res) => page.render(req, res)) server.listen(3000, () => console.log('Listening on http://localhost:3000')) ```
-
由 Tim Neutkens 提交于
-
由 Adam Lane 提交于
The current reasonml needs an example of how to do getInitialProps. tmepple posted the only known way of doing it in [this comment](https://github.com/zeit/next.js/issues/4202#issuecomment-439175214). It is unlikely reasonml users are going to discover that comment or figure it out on their own so having it in an example is critical. Also, dependencies updated. After updating dependencies, I get this error: ``` ModuleBuildError: Module build failed (from ./node_modules/next/dist/build/webpack/loaders/next-babel-loader.js): [1] Error: Cannot find module '@babel/core' [1] babel-loader@8 requires Babel 7.x (the package '@babel/core'). If you'd like to use Babel 6.x ('babel-core'), you should install 'babel-loader@7'. ``` Seems like @babel/core is required as peer dependency per [this comment](https://github.com/babel/gulp-babel/issues/124#issuecomment-326853222) so I added it. The way to do getInitialProps has changed in 7.0.2 canary so this also has a comment in the code about what change is required to get that working.
-
- 01 1月, 2019 6 次提交
-
-
由 Tim Neutkens 提交于
As getUrl() is already called and passed to initialization: https://github.com/zeit/next.js/blob/canary/packages/next/client/index.js#L46
-
由 JJ Kasper 提交于
Saw a reply on the original pull request that the WebSocket using a random port broke their set up so I added a `--websocket` or `-w` argument similar to the `-p` argument to allow manually setting this port also.
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
-
- 31 12月, 2018 1 次提交
-
-
由 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
-
- 28 12月, 2018 2 次提交
-
-
由 Tim Neutkens 提交于
-
由 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
-
- 27 12月, 2018 4 次提交
-
-
由 Giuseppe 提交于
The latest version includes a fix to resolve conflicts with other libraries that use the `css` prop. Details https://github.com/zeit/styled-jsx/releases/tag/v3.1.3
-
由 Anderson Leite 提交于
-
由 Anderson Leite 提交于
-
由 Rafael Mariano 提交于
Explains in details how the "with-universal-configuration" example works and rename it to "with-universal-configuration-build-time". Changing the example name makes the purpose of the example clear. The "env-config.js" file introduce one more sample of variable usage that instantiates an immediate value of the local environment variable. This makes it even clearer how build-time variable configuration works. The "index.js" page makes explicit the use of these configured environment variables. The universal configuration confusion happens when the value of the environment variable is used directly in the application causing an effect in server-side but not on the client side.
-
- 26 12月, 2018 1 次提交
-
-
由 Jeroen Knoops 提交于
Upgrades webpack from 4.26.0 -> 4.28.2 Adds webpackbar for build. Fixes #5777
-
- 24 12月, 2018 4 次提交
-
-
由 Steven Bell 提交于
-
由 Jean 提交于
This example show how you can test Next.js apps with [react-testing-library](https://github.com/kentcdodds/react-testing-library). This library encourages your applications to be more accessible and allows you to get your tests closer to using your components the way a user will, which allows your tests to give you more confidence that your application will work when a real user uses it. And also, is a replacement for enzyme. <img width="733" alt="Image showing the words next.js + react testing library" src="https://user-images.githubusercontent.com/4689228/50387208-40223200-06de-11e9-9358-607092eb25a0.png">
-
由 Zack Tanner 提交于
This fixes the `with-jest-typescript` example to keep jest in sync with babel-jest (also updated to the latest of both). Having them resolve to different versions was resulting in weird errors. When attempting to update the `transform` property in `jest.setup.js` to add babel-jest support to *.js/jsx files, it would throw: > Plugin 0 specified in "node_modules/next/babel.js" provided an invalid property of "default" (While processing preset: "node_modules/next/babel.js") Indirectly, this will fix https://github.com/zeit/next.js/issues/5917, once the author updates `jest.setup.js` to have: ```js transform: { '^.+\\.(js|tsx)?$': 'babel-jest', }, ```
-
- 23 12月, 2018 1 次提交
-
-
由 Zihua Wu 提交于
Babel related content in README.md is updated according to the updated .babelrc
-
- 21 12月, 2018 1 次提交
-
-
由 Michael Hsu 提交于
This example show how you can use Next.js with [Carlo](https://github.com/GoogleChromeLabs/carlo). ```bash npm run dev npm run build npm start ``` #### Demo ![large gif 582x438](https://user-images.githubusercontent.com/1527371/50331830-0ebd3100-053b-11e9-8d9c-d792ce0065fa.gif)
-