Live data from Hacker News

Next.js 7

nextjs.org

21–30 of 40 posts

Re: Next.js 7

#21
post #2

Not clear to me from the release notes if there now is an easy way to proxy to a server in development (if you for instance have a Django driven API on port 8000). This is easily done with create-react-app by just adding a line in package.json. In Next you've had to either set up and configure nginx locally or proxia via an Express server, both options that that are a bit of a hassle to set up for such a common case.

create-react-app is actually removing this feature in an upcoming release. We don't have plans to include it as a feature to Next.js as you can already implement it using a custom server. We do have an example for it: https://github.com/zeit/next.js/tree/canary/examples/with-cu...

Why is it being removed?

Re: Next.js 7

#22
post #2

Not clear to me from the release notes if there now is an easy way to proxy to a server in development (if you for instance have a Django driven API on port 8000). This is easily done with create-react-app by just adding a line in package.json. In Next you've had to either set up and configure nginx locally or proxia via an Express server, both options that that are a bit of a hassle to set up for such a common case.

Setting up http-proxy-middleware via Express in a Next.js app is under 10 lines of code.

Re: Next.js 7

#24

Could anyone explain what Next.js is? I use React (using create-react-app), but I'm under impression that React is a JavaScript framework (like Spring is Java framework, or RoR is Ruby framework). So Next.js is a framework for a framework?

React is more of a library instead of a framework and it's just the view layer. Next.js is a framework(minimalist) for React.

https://github.com/zeit/next.js/

Re: Next.js 7

#25
post #2

Not clear to me from the release notes if there now is an easy way to proxy to a server in development (if you for instance have a Django driven API on port 8000). This is easily done with create-react-app by just adding a line in package.json. In Next you've had to either set up and configure nginx locally or proxia via an Express server, both options that that are a bit of a hassle to set up for such a common case.

In a Next.js + Now context you'd use the path alias feature [1] of now in production, using a rules.json file to do the route mappings to other microservices or external URLs.

In development you'd use micro-proxy [2] and define a rules-dev.json with local mappings, and then have a package.json script to fire up that proxy for local testing.

[1] https://zeit.co/docs/features/path-aliases#path-alias

[2] https://github.com/zeit/micro-proxy

Re: Next.js 7

#26
post #3

Time and time again, the Next.js (and Zeit) team blow me away. The rate at which they release new, high-quality versions of their products is astounding, especially given how few people are working on this full time -- it's basically just Tim Neutkens, who's insane: he's constantly pushing updates, reviewing PRs, and finds time to be very active on the support channel. We use a bunch of Zeit's tools (particularly Nex…

Curious why you didn't mention Arunoda -- does he not work on it anymore. IIRC Arunoda started Next.js right after (perhaps because of) leaving Meteor ecosystem.

Re: Next.js 7

#27

Earlier quoted context omitted.

create-react-app is actually removing this feature in an upcoming release. We don't have plans to include it as a feature to Next.js as you can already implement it using a custom server. We do have an example for it: https://github.com/zeit/next.js/tree/canary/examples/with-cu...

Why is it being removed?

To let an external express server handle it. Which they think will be better than the current in house solution.

Re: Next.js 7

#28

so with Next for SSR you use React as a templating engine and just send that back?

Kind of.... Just it is easier comparing with other server side web application framework...

Re: Next.js 7

#29

so with Next for SSR you use React as a templating engine and just send that back?

Sort of. Next expects to find a file structure of scripts in the /pages directory. On the initial load of say www.nextsite.com/about/location, Next will by default try to render the file /pages/about/location.js or /location/index.js.

You can add an asynchronous function called .getInitialProps, which should return some props that are required for the page. On the initial load, Next will first run through getInitialProps, then render the actual component with those props. From then on, assuming you're using 'next/link' for routing, everything should work like a single page app. All of the pages except for the initial one are rendered on the client.

Re: Next.js 7

#30

Could anyone explain what Next.js is? I use React (using create-react-app), but I'm under impression that React is a JavaScript framework (like Spring is Java framework, or RoR is Ruby framework). So Next.js is a framework for a framework?

> Next.js is a minimalistic framework for server-rendered React applications. https://github.com/zeit/next.js/ So a specialized framework based on another framework

React by itself isn't really a framework.
Post reply on HN