Wednesday, August 5, 2015

Creating Isomorphic Apps with Node.js, React, and Express

Over the past few years, the Web community has been abuzz with “isomorphic apps”. They are apps where the markup is rendered on the server and fed to the browser as complete HTML, and the successive user interactions are handled by client side rendering. This is useful as it lead to outcomes like faster page loading, better search engine indexing, and better user experience. In this tutorial, we’ll crate a simple isomorphic app that uses Node, React, and Express to understand the underlying process behind it.

The Tech Stack

In this article, we’re going to use following software:

  • React: the UI framework that can rendered on both server and client.
  • webpack: a module bundler to be used for bundling JavaScript.
  • Express: the application server framework for Node.js.
  • react-router: the routing solution specially developed for React.js.
  • Babel: the JavaScript compiler with built-in support for ES2015 syntax and JSX.
  • Jade: a JavaScript powered templating engine that works on both server and client side.

Project Setup

Let's start the project by upgrading to Node v.0.12.6 and creating an empty directory that will act as our project folder. Once done, run the npm init command in the newly created directory and fill up the presented questions. The next thing we need to do is to install all the required packages. Execute the following command to achieve this task:

$ npm install --save-dev babel babel-loader express jade react react-hot-loader react-router webpack webpack-dev-sever nodemon

When the installation process is completed, we have to create a src folder inside our project folder. Then, we have to create the following directories inside src:

  • server: where the backend Node.js server and webpack dev server will reside.
  • client: this will be the entry point to handle React bundle.
  • shared: this folder will hold app's components, flux, routes, etc.

Continue reading %Creating Isomorphic Apps with Node.js, React, and Express%


by Preetish Panda via SitePoint

This Week's HTML5 and Browser Technology News (Issue 200)


Read this e-mail on the Web
HTML 5 Weekly
Issue 200 — August 5, 2015
Wired
A writeup about how the precision in values provided by the Battery Status API could be used to track users who otherwise didn’t want to be tracked. If you want more detail, here’s the academic paper (PDF) behind it.


Jake Archibald
Chrome developer advocate Jake Archibald argues that the modern Web isn’t more complicated to code for but that users have higher expectations and halting technological advancements is not a worthwhile strategy.


SitePoint
A method that involves checking for browser capabilities before loading further CSS and JavaScript to give the user an enhanced experience.


Frontend Masters  Sponsored
Get access to your choice of a full-week of in-depth video lessons. Choose from either Introduction to Web Development, Angular, or Advanced JavaScript -- completely free!

Frontend Masters

W3C
Defines a mechanism to allow web developers to instruct a user agent to clear a user’s locally stored data related to the current host and its subdomains.


Vincent De Oliveira
A look at two cutting edge CSS filter features: backdrop-filter, and a filter specifically for backgrounds only.


BBC R&D
A (PDF) paper describing a new approach to displaying subtitles alongside HTML5 video content in a responsive manner.


Tuts+
You like quizzes, right? This one’s only 9 questions long.


Mozilla Hacks
Pointer events are now supported in the nightly builds of Firefox. Check out this article for details and how to use the API.


Jobs

  • Intercom is looking for Software Engineers for our product team in Dublin, IrelandDo you obsess about the quality of the work you produce and know how to use the right tools and technologies for a problem? Join our exceptional team, we offer relocation and work permit application assistance. Intercom
  • Front End Engineer Storefront is a well-funded, online marketplace looking for a talented front-end engineer excited to build customer-facing features and solve cool problems. Want to be apart of the Pop Up Shop phenomenon? If so, apply today through AngelList. Storefront
  • Apply to top SF & NYC startups in 60 secondsWant to spend less time job searching? Apply to Underdog.io and startup decision-makers will email you directly. You decide where to interview and where to work. No risk. Your information is kept private from current & past employers. Underdog.io

In brief

Curated by Peter Cooper and published by Cooper Press.
Send feedback by simply replying to this mail.
Want to sponsor an issue? See our media kit.
Want to post a job? E-mail us or use our self-serve system.

Unsubscribe : Change email address : Read this issue on the Web

© Cooper Press Ltd. Office 30, Lincoln Way, Louth, LN11 0LS, UK
Email policy Privacy policy


by via HTML5 Weekly

Responsive Solutions for Feature Comparison Tables

Responsive Web Design and tables are not necessarily the best of friends. Many people have researched the situation and a lot of approaches have been devised (some of them were even rounded up in a recent article here on SitePoint). However we are still far away from the perfect solution and the search continues.

While things are still complicated in the generic case, certain specific cases can be treated with a lot more attention. I am talking here about the feature comparison table. We encounter it in many places – when choosing a car and trying to decide what extra options to choose; on web hosting websites when comparing plans and features; on any membership-based portal that lets you decide what features you need to receive in exchange for your money.

Because this kind of table has a relatively stable and consistent structure, it is possible to coax a better behavior when displayed on small screens.

Anatomy of a Feature Comparison Table

The classic comparison table brings together at least three products (displayed in columns) while the features are displayed on rows below. In the traditional structure, the first cell of each row has the name of the feature, while the cells under each product have a checkmark or some other symbol, showing whether that feature belongs to the product or not. We can find great examples of this classic structure: here, here, and here

Based on these examples, we can summarize the structure of a comparison table with the following code:

[code language="html"]

  Product 1 Product 2 Product 3
Feature 1
Feature 2
Feature 3
Feature 4

[/code]

It is easy to identify the elements mentioned earlier: the product names, the feature names, and the marks that show whether the feature is present or not. Note that the ✔ code represents a checkmark (✔) character.

We now arrive at the root of the problem. In order for the table to maintain optimum effectiveness at low screen widths, a few conditions must be fulfilled:

  • The user must be able to easily differentiate the products;
  • The features must be easily identifiable; and
  • It must be clear if a feature for a product is present or not.

The best way to achieve this result is to shift the cell containing the feature name on top of the other three cells that mark the presence or absence of the feature.

First Solution: Flexbox

How can we get this to happen? One answer is flexbox. If you don’t know what flexbox is or if you need a refresher, you can check out Nick Salloum’s recent article on the topic. The rest of us can dive into the solution.

First we need to make sure our changes happen only on small screens. For this to happen, we target our code using a media query, using the classic width of 768px as a breakpoint:

Continue reading %Responsive Solutions for Feature Comparison Tables%


by Adrian Sandu via SitePoint

textrapoland

New version of textrapoland – warehousing / transport / forwarding / intrastat company based in Poland. Fully responsive, well animated and fresh website.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Web Courses Bangkok

A custom designed template on WordPress that is far from the normal boring school websites. Web Courses Bangkok continues to win awards for design and teaching and this is no exception to the norm.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

FEXCO Finance and Business Solution

New responsive website for FEXCO, a multinational finance and business solutions provider, with operations in 28 countries worldwide.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Colors Infotech

Colors Infotech, based in the financial heartland of Mumbai – India, is a Creative agency and consulting company providing services in architectural rendering, website designing, branding, and digital marketing.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery