News for hackers. Stuff that matters.
Re:Netlify Dev by pcr910303 on Tuesday April 09, 2019 @11:56AM (#19615958)
I instantly thought of the incomplete/error prone Zeit Now dev that was introduced a few weeks ago. If this(Netlify Dev) can replicate the entire system stably I might move on to Netlify Edge. Replicating and testing is a pretty big deal :-)

Offtopic, but can anyone explain the differences between Zeit Now v2 and Netlify Edge?

Re:Netlify Dev by evanweaver on Tuesday April 09, 2019 @01:25PM (#19616989)
Netlify Dev also includes support for accessing FaunaDB GraphQL Cloud, launched in beta today (https://fauna.com/blog/getting-started-with-graphql-part-1-i...).

We are working on adding support for a 100% local development workflow in Netlify Dev. It would be lovely to know what you think is missing from stateful local workflows in both Zeit and Netlify.

Re:Netlify Dev by rymate1234 on Tuesday April 09, 2019 @12:11PM (#19616146)
As far as I'm aware, zeit now can run server side code whereas netlify edge can only do at most some serverless functions, and is otherwise focused entirely on serving the front end
Re:Netlify Dev by icebraining on Tuesday April 09, 2019 @12:16PM (#19616197)
Zeit Now also seems to target serverless functions, not stateful applications.
Re:Netlify Dev by rymate1234 on Tuesday April 09, 2019 @04:52PM (#19618831)
Yeah but with Zeit Now the serverless functions can actually serve the application, so if you need SSR with dynamic data you're able to, whereas with netlify it's static html being served with optional AWS style lambda functions.

For instance Zeit can host a standard node server to serve your application if necessary https://zeit.co/docs/v2/deployments/official-builders/node-j...

Re:Netlify Dev by bobfunk on Tuesday April 09, 2019 @06:30PM (#19619618)
You can do the same with Netlify functions. Here's an example:

https://github.com/netlify-labs/netlify-functions-express

Re:Netlify Dev by rymate1234 on Wednesday April 10, 2019 @04:56AM (#19622955)
That example doesn't serve the main website, like all netlify functions they can only handle requests under the .netlify route for functions https://express-via-functions.netlify.com/.netlify/functions...

Whereas on Zeit Now the root of the website can be a web server written in multiple languages, and offer the ability to make your own "Lambda Builder" if necessary https://zeit.co/docs/v2/deployments/builders/overview

Re:Netlify Dev by bobfunk on Wednesday April 10, 2019 @10:53AM (#19625272)
You can rewrite URLs to serve the main website as well. We're generally bullish on but DJing server side rendering, but a rule like this totally works:

/* /.netlify/functions/app/:splat 200!

Re:Netlify Dev by k__ on Tuesday April 09, 2019 @11:58AM (#19615973)
Yes, I have the feeling the whole "replicate locally" goes in the wrong direction.

You're just lying to yourself when saying local is the same as cloud...

Re:Netlify Dev by sudhirj on Tuesday April 09, 2019 @12:11PM (#19616149)
If your cloud edge functions only (completely stateless functions or containers run without any directly attached data stores) then you can pretty reliably simulate it locally - you can configure your own dev machine as an edge node.

Stuff like Lambda@Edge, Cloudflare Workers etc all have very strictly defined APIs that are executed on V8 (modified for security, but not enough to be incompatible). If you run a pure function on your local machine you can be pretty sure it’ll run on the edge.

We’ve already done this quite well with Docker - the image you run locally is cryptographically the same binary bytes you’ll run on production. It’s not that surprising to see it for edge functions.

Re:Netlify Dev by k__ on Tuesday April 09, 2019 @12:27PM (#19616326)
Sure if you doing unit-tests/one function that works.

But as far as I know, unit tests aren't the place to be in terms of serverless testing.

Integration and E2E tests are much more important and that's where the whole "run locally" stuff breaks down rather quickly.

Re:Netlify Dev by icebraining on Tuesday April 09, 2019 @12:11PM (#19616137)
Why? They're just computers, what makes your local machine that different from a Netlify server?
Re:Netlify Dev by k__ on Tuesday April 09, 2019 @12:29PM (#19616366)
Because functions are small self-contained stateless bits of code, they don't need much testing by themselves.

You need to test them with the services they are using and replicating your whole cloud infrastructure locally is nearly impossible.

Re:Netlify Dev by icebraining on Tuesday April 09, 2019 @03:59PM (#19618368)
Maybe they'll tell me I'm wrong, but Netlify strikes me as not targeting people who need a "whole cloud infrastructure" (since they don't offer many services), but a static site with a few simple backend functions.
Re:Netlify Dev by k__ on Tuesday April 09, 2019 @07:15PM (#19619964)
Cloud be, yes.