- 28 9月, 2018 3 次提交
-
-
由 Luc 提交于
* show warning if there is a title in _document.js Head * dont loop through children in production * only 1 loop through this.props.children
💪 * also raise warning in test env * check for null childs -
由 Yuri Yakovlev 提交于
-
由 Tim Neutkens 提交于
- This makes sure the Next.js renderer / server doesn't have a dependency on the `http` module. - Splits out util functions for SSR only - Removes obsolete methods / methods that weren't being tree-shaken
-
- 27 9月, 2018 6 次提交
-
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
-
由 Henrik Wenz 提交于
To work with babel7 & next7.
-
由 Arek Mytych 提交于
-
- 26 9月, 2018 5 次提交
-
-
由 Resi Respati 提交于
* [with-typescript] Updated `@zeit/next-typescript` and typescript typings * [with-typescript] Updated tsconfig to match new recommended config * [with-typescript] upgraded dependencies, implement type-checking * [with-typescript] add _document example, fixed tsconfig * [with-typescript] updated README * [with-typescript] updated example contents * [with-typescript] adopt the Layout component from Flow example
-
由 Henrik Wenz 提交于
An upstream bug in webpack-dev-middleware caused unhandled rejections to be swallowed.
-
由 Tim Neutkens 提交于
-
由 Matthew Francis Brunetti 提交于
Since version 2.1, react-apollo is exposing some new components that use the function-as-child (or render-prop) pattern to let you connect apollo-client magic with your components. See the blog article: [New in React Apollo 2.1](https://www.apollographql.com/docs/react/react-apollo-migration.html) If I'm not mistaken, it's generally agreed that this pattern is (where it works) superior to the HOC pattern, for reasons that are best explained here: https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce So I updated the with-apollo example to use the new API, and IMO this code is much simpler and natural to read and understand, especially if you are not already familiar with Apollo's HOC APIs. I broke up my changes into separate commits, for easier review. Commits with "Refactor" in the message accomplish the goal of switching to the new APIs while minimizing line-by-line differences (select "Hide whitespace changes" under "Diff settings"). Commits with "Clean up" in the message follow up the refactoring with trivial things like reorganizing code sections, renaming variables, etc. For the components doing mutations, I chose not to use the `Mutation` component, since that doesn't really make sense to me; a mutation is something that happens at a point in time, so it's not meaningful to represent a mutation in the markup, which exists for a period of time. All that component does is expose a `mutate` function for a single specified mutation, and `result` data for a single firing of the mutation (which we don't need anyways; apollo handles updating the local data with the result). To me it seems simpler and more flexible to just get the apollo client via `ApolloConsumer` and call `.mutate()` on it. In case anyone is interested, here's what my version of `PostUpvoter` using the `Mutation` component looked like: <details> ```jsx import React from 'react' import { Mutation } from 'react-apollo' import { gql } from 'apollo-boost' export default function PostUpvoter ({ votes, id }) { return ( <Mutation mutation={upvotePost}> {mutate => ( <button onClick={() => upvote(id, votes + 1, mutate)}> {votes} <style jsx>{` button { background-color: transparent; border: 1px solid #e4e4e4; color: #000; } button:active { background-color: transparent; } button:before { align-self: center; border-color: transparent transparent #000000 transparent; border-style: solid; border-width: 0 4px 6px 4px; content: ''; height: 0; margin-right: 5px; width: 0; } `}</style> </button> )} </Mutation> ) } const upvotePost = gql` mutation updatePost($id: ID!, $votes: Int) { updatePost(id: $id, votes: $votes) { id __typename votes } } ` function upvote (id, votes, mutate) { mutate({ variables: { id, votes }, optimisticResponse: { __typename: 'Mutation', updatePost: { __typename: 'Post', id, votes } } }) } ``` </details> ### I'm happy with where things are at here, but I'm more than happy to address any comments, concerns, ideas for improvent! Thanks!
-
由 Tim Neutkens 提交于
-
- 25 9月, 2018 3 次提交
-
-
由 Tim Neutkens 提交于
As they were failing intermittently, this PR tries to solve that.
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
* Add failing tests * Upgrade wd module * Pass dynamic import webpack ids to the client side * Pass through webpack ids to initalializer and only use those * Compile dynamic(import()) to dynamic(() => import()) * Default dynamicIds * Use forked hard-source-plugin * Possibly fix test * Make tests fail less intermittently * Temporarily disable hard-source in production * Make sure dynamic import chunks are unique * Disable hard-source * Log html if error is thrown * Fix test
-
- 24 9月, 2018 4 次提交
-
-
由 Zack Tanner 提交于
This fixes https://github.com/zeit/next.js/issues/5260 by making sure that `index.js` has `getInitialProps` defined on the page exported component, not the child component. When fixing that, I uncovered an issue where the server side rendered HTML did not match the clientside HTML, so I reworked _app.js to use the `i18nextprovider` component which has props to hydrate the initial data (for SSR), and makes sure the correct i18n instance is passed to all child components through context. Before: ```html <!DOCTYPE html> <html> <head> <meta charSet="utf-8" class="next-head"/> <link rel="preload" href="/_next/static/development/pages/index.js" as="script"/> <link rel="preload" href="/_next/static/development/pages/_app.js" as="script"/> <link rel="preload" href="/_next/static/development/pages/_error.js" as="script"/> <link rel="preload" href="/_next/static/runtime/webpack.js" as="script"/> <link rel="preload" href="/_next/static/runtime/main.js" as="script"/> </head> <body> <div id="__next"></div> <script src="/_next/static/development/dll/dll_4a2ab6ce0cb456fbfead.js"></script><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/","pathname":"/","query":{},"buildId":"development"};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/" src="/_next/static/development/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/development/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/development/pages/_error.js"></script><script src="/_next/static/runtime/webpack.js" async=""></script><script src="/_next/static/runtime/main.js" async=""></script> </body> </html> ``` After: ```html <!DOCTYPE html> <html> <head> <meta charSet="utf-8" class="next-head"/> <link rel="preload" href="/_next/static/development/pages/index.js" as="script"/> <link rel="preload" href="/_next/static/development/pages/_app.js" as="script"/> <link rel="preload" href="/_next/static/development/pages/_error.js" as="script"/> <link rel="preload" href="/_next/static/runtime/webpack.js" as="script"/> <link rel="preload" href="/_next/static/runtime/main.js" as="script"/> </head> <body> <div id="__next"> <h1>This example integrates react-i18next for simple internationalization.</h1> <div> <h1>welcome to next.js</h1> <p>This example integrates react-i18next for simple internationalization.</p> <p>test words for en</p> <div><button>fire in the wind for en</button></div> <p>You can either pass t function to child components.</p> <p>Or wrap your component using the translate hoc provided by react-i18next.</p> <p>Alternatively, you can use <code>Trans</code> component.</p> <a href="/page2">Go to page 2</a><br/><a href="/page3">Go to page 3 (no hoc)</a> </div> </div> <script src="/_next/static/development/dll/dll_4a2ab6ce0cb456fbfead.js"></script><script>__NEXT_DATA__ = {"props":{"pageProps":{"i18n":null,"initialI18nStore":{"en":{"home":{"welcome":"welcome to next.js","sample_test":"test words for en","sample_button":"fire in the wind for en","link":{"gotoPage2":"Go to page 2","gotoPage3":"Go to page 3 (no hoc)"}},"common":{"integrates_react-i18next":"This example integrates react-i18next for simple internationalization.","pureComponent":"You can either pass t function to child components.","extendedComponent":"Or wrap your component using the translate hoc provided by react-i18next.","transComponent":"Alternatively, you can use \u003c1\u003eTrans\u003c/1\u003e component."}}},"initialLanguage":"en-US"}},"page":"/","pathname":"/","query":{},"buildId":"development"};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/" src="/_next/static/development/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/development/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/development/pages/_error.js"></script><script src="/_next/static/runtime/webpack.js" async=""></script><script src="/_next/static/runtime/main.js" async=""></script> </body> </html> ```
-
由 John Leon 提交于
* Update .babelrc babel-plugin-transform-decorators-legacy does not exist in babel 7 in replace use @babel/plugin-proposal-decorators * Update package.json Acording the last commit please, test this example , will be work .
-
由 Adam Lane 提交于
Trivial note to remind anyone doing sentry that they should consider doing server side logging too.
-
由 Adam Lane 提交于
Noting per https://github.com/zeit/next.js/issues/5050 for new users of Apollo that they should not be concerned about multiple renders.
-
- 23 9月, 2018 5 次提交
-
-
由 Henrik Wenz 提交于
* Allow deadCodeElemination when using process.browser * Add process.browser test
-
由 Henrik Wenz 提交于
Follow up on: https://github.com/zeit/next.js/pull/4639
-
由 Henrik Wenz 提交于
- updates transform-decorators-legacy - updates with-next-redux-wrapper
-
由 Henrik Wenz 提交于
-
由 Henrik Wenz 提交于
Wonder how that one got through
🤔
-
- 22 9月, 2018 3 次提交
-
-
由 Arek Mytych 提交于
-
由 Muhaimin CS 提交于
-
由 Iago Bruno 提交于
I think it looks better for new people in JavaScript/React (and for my perfectionism
😄 ).
-
- 21 9月, 2018 2 次提交
-
-
由 Arek Mytych 提交于
Fixes the example with next.js@7 Fixes #5238
-
由 Alessandro 提交于
FIX https://github.com/zeit/next.js/issues/5234 It simply needed to update dependencies
-
- 20 9月, 2018 9 次提交
-
-
由 Tim Neutkens 提交于
-
由 Eugene 提交于
Update to new @babel/plugin-proposal-decorators, @babel/plugin-proposal-class-properties plugins version.
-
由 Yuri Yakovlev 提交于
-
由 Damian Stasik 提交于
Since `__next-error` is no longer necessary, there is no need to wrap the `__next` div in `Fragment`.
-
由 Ian Mitchell 提交于
-
由 Julien Bouquillon 提交于
-
由 Tim Neutkens 提交于
Fixes #5210
-
由 Tim Neutkens 提交于
-
由 Tim Neutkens 提交于
# Conflicts: # package.json
-