Best practices for JavaScript function parameters

  • The problem with passing an object as a parameter to a function is that it’s not clear what values you should put into it.
  • One common thing in FP is to partially apply your functions, which is much harder to do if your function takes its parameters as an object.
  • While separate parameters are a good starting point, we run into trouble as soon as the function has optional parameters.
  • For functions with a single optional parameter, the solution is simple:

    Best practice: optionals come last

    However, if we have more than one optional parameter, the problem is… what if we only need to pass one optional parameter?

  • You can pass in parameters easily as an object, but the properties for the object can be easily seen from the function’s signature.

From time to time, people ask things like “should I use objects to pass function arguments”. I’m sure you recognize the pattern, as it’s common with many libraries:
Continue reading “Best practices for JavaScript function parameters”

ZEIT – Next.js 2.0

We are Proud to Introduce Next 2.0 to the World  #reactjs #nextJS #javascript #webdev

  • When we launched Next.js, there was no way to do dynamic routing or load your custom server code.
  • e.g: no waiting for a Next.js release after React gets updated You can experiment with alternative implementations of the React API.
  • Our implementation, Next News , is fully server-rendered, queries the data over Firebase and updates in realtime as new votes come in.
  • Each top-level component (page) in Next.js defines the entirety of the document .
  • We’re very thankful to our community for having submitted so many examples of backends (Express, HAPI, Koa…), styling systems (cxs, glamor, styled-components…), testing systems (jest), type systems (TypeScript and Flow), data fetching (Apollo) and many others.

Next.js 2.0 comes packed with performance improvements and extensibility features
Continue reading “ZEIT – Next.js 2.0”

ZEIT – Next.js 2.0

Next.js 2.0: #ReactJS made easy and simple  #JavaScript

  • When we launched Next.js, there was no way to do dynamic routing or load your custom server code.
  • e.g: no waiting for a Next.js release after React gets updated You can experiment with alternative implementations of the React API.
  • Our implementation, Next News , is fully server-rendered, queries the data over Firebase and updates in realtime as new votes come in.
  • Each top-level component (page) in Next.js defines the entirety of the document .
  • We’ve very thankful to our community for having submitted so many examples of backends (Express, HAPI, Koa…), styling systems (cxs, glamor, styled-components…), testing systems (jest), type systems (TypeScript and Flow), data fetching (Apollo) and many others.

Next.js 2.0 comes packed with performance improvements and extensibility features
Continue reading “ZEIT – Next.js 2.0”

ZEIT – Next.js 2.0

Next.js 2.0

  • When we launched Next.js, there was no way to do dynamic routing or load your custom server code.
  • This has tremendous benefits, at the tiny cost of two extra parameters in the initial `install` to set up your project:

    Our mission is to make Next.js as familiar as possible to developers on the Web Platform.

  • Each top-level component (page) in Next.js defines the entirety of the document .
  • We’ve very thankful to our community for having submitted so many examples of backends (Express, HAPI, Koa…), styling systems (cxs, glamor, styled-components…), testing systems (jest), type systems (TypeScript and Flow), data fetching (Apollo) and many others.
  • This will allow for server-rendered pages that expose different JS components according to the data they used, for example.

Next.js 2.0 comes packed with performance improvements and extensibility features
Continue reading “ZEIT – Next.js 2.0”

Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa — Building Apollo — Medium

Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa  #ReactJS

  • We removed support for defining GraphQL schemas in schema language and moved it to an entirely separate npm module – graphql-tools .
  • We also wanted to make the project more maintainable by using TypeScript.
  • Express-graphql could adopt those features of Apollo Server which have proven themselves in practice.
  • Query Batching is a feature we recently introduced in Apollo Client, but it involved merging multiple queries into a single one, which made the queries sent to the server hard to read.
  • Apollo Server is a GraphQL server for JavaScript, built by an open-source community of GraphQL enthusiasts.

Read the full article, click here.


@ReactiveConf: “Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa #ReactJS”


A simple and modular GraphQL server for Node.js


Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa — Building Apollo — Medium

Server Side Rendering vs Client Side Rendering ?

Basic diff. between Server Side Rendering vs Client Side Rendering : 

#JavaScript #ReactJS

  • Very simple put, in this model, the server provides with a page which is already populated with the data.
  • It’s just that your server uses the same templates/components to render the app on server.
  • Say you have a simple web application which displays the pictures of cats, and people can vote on how cute a cat is.
  • server.route( { method: ‘GET’ , path: ‘/cats’ , handler: ( request, reply ) => { /* For the sake of this example, imagine that the constant `data` is already populated with the data; similar to the JSON I have in the previous example */ const cats = …
  • Server-side Rendering — the server sends a pre-rendered (i.e., all the steps I outlines above been executed on the server-side) page, and that is displayed to the user.

Read the full article, click here.


@Hashnoder: “Basic diff. between Server Side Rendering vs Client Side Rendering :

#JavaScript #ReactJS”


Can some help me to understand the basics of server side rendering and client side rendering? And also the difference between them? When to use what? etc… Tagged with Programming.


Server Side Rendering vs Client Side Rendering ?