- 10 Feb, 2019 3 commits
-
-
Tim Neutkens authored
-
Tim Neutkens authored
This reverts commit ab46c451.
-
Tim Neutkens authored
* Bring in terser-webpack-plugin (backport #6231 to master) * Use correct path for ignore * Comment out schema
-
- 11 Jan, 2019 1 commit
-
-
tangye authored
original code in `/lib/router/router.js` ``` urlIsNew (pathname, query) { return this.pathname !== pathname || !shallowEquals(query, this.query) } ``` the urlIsNew compare `this.pathname` to an argument `pathname` the invokers: ``` // If asked to change the current URL we should reload the current page // (not location.reload() but reload getInitialProps and other Next.js stuffs) // We also need to set the method = replaceState always // as this should not go into the history (That's how browsers work) if (!this.urlIsNew(asPathname, asQuery)) { method = 'replaceState' } ``` the parameter here is `asPathname` destructured from `asPath` so here is a problem when we reuse a single page rendered in two asPaths pages/a.js ``` <> <Link href='/a'><a>goto a</a></Link> <Link href='/a' as='/b'><a>goto b</a></Link> </> ``` If we navigate to page /a, then click 'goto b', actually the history is replaced, not pushed. It is expected that history could be correctly pushed and popped as long as the browser url is changed.
-
- 16 Dec, 2018 1 commit
-
-
Dale Inverarity authored
Without `@tailwind components;` plugins (like container which is added by default) will not work. See: https://github.com/tailwindcss/tailwindcss/issues/446#issuecomment-378792892 for details
-
- 10 Dec, 2018 2 commits
-
-
Adam Stankiewicz authored
* Improve with-sentry example * remove nonexisting keys from request and update errorInfo handling * readd query and pathname * read query and params and add pathname and query to client
-
Oscar Busk authored
This PR Fixes #4920 So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules. ``` Error: Cannot find module '/user_code/next/server/bundles\pages\index.js ``` My simple solution is to modify the `pages-manifest.json` to always use linux separator (`/`), then also modify `server/require.js` to, when requiring page, replace any separator (`\` or `/`) with current platform-specific file separator (`require('path').sep`). The fix in `server/require.js` would be sufficient, but my opinion is that having some cross-platform consistency is nice. This change was tested by bulding an application in windows and running it in linux and windows, aswell as building an application in linux and running it in linux and windows. The related tests was also run.
-
- 02 Dec, 2018 1 commit
-
-
Justin Stahlman authored
The demo did not work. Updating to babel-plugin-inline-react-svg v1.0.1 did work.
-
- 15 Oct, 2018 1 commit
-
-
Muhaimin CS authored
-
- 11 Oct, 2018 2 commits
-
-
Tim Neutkens authored
-
Tim Neutkens authored
Same as #5424
-
- 29 Sep, 2018 8 commits
-
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Henrik Wenz authored
We don't need to `React.cloneElement`, twice.
-
Henrik Wenz authored
This PR removes the obsolete `_containerProps` context.
-
- 28 Sep, 2018 8 commits
-
-
Tim Neutkens authored
-
Carlos authored
### Next js 7+ and Typescript 3+ Example No babel, tsc, pure typescript usage Made by [next-with-typescript plugin](https://github.com/echoulen/next-with-typescript)
-
Tim Neutkens authored
-
Mert Can authored
-
Tim Neutkens authored
* Remove obsolete check in dev-server * Don’t require package.json at runtime Inline the Next.js version at publish time, so that there’s no runtime dependency for this
-
Tim Neutkens authored
Remove `if(this.hotReloader)` as it's always guaranteed to be there. https://github.com/zeit/next.js/pull/5317#discussion_r221233064
-
Tim Neutkens authored
-
Tim Neutkens authored
* Initial dev server * Remove obsolete check * Move hotReloader to dev-server * Use parent renderErrorToHTML to remove dep on render.js * Remove dev option from server itself
-
- 27 Sep, 2018 9 commits
-
-
Luc authored
* 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 authored
-
Tim Neutkens authored
- 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
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Tim Neutkens authored
-
Henrik Wenz authored
To work with babel7 & next7.
-
Arek Mytych authored
-
- 26 Sep, 2018 2 commits
-
-
Resi Respati authored
* [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 authored
An upstream bug in webpack-dev-middleware caused unhandled rejections to be swallowed.
-
- 25 Sep, 2018 2 commits
-
-
Tim Neutkens authored
-
Matthew Francis Brunetti authored
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!
-