JavaScript for Line of Business Applications
606.6K views | +11 today
JavaScript for Line of Business Applications
Keeping track of current JavaScript Frameworks that help design your clientside Business Logic Layers.
Curated by Jan Hesse
Beam to my Inbox:
Your new post is loading...
Your new post is loading...

Popular Tags - Filter using the Funnel

Scoop.it!

Code Coverage of Mocha Tests using Istanbul and Karma

Code Coverage of Mocha Tests using Istanbul and Karma | JavaScript for Line of Business Applications | Scoop.it

Many JavaScript projects are using Mocha to run the unit tests. Combining Mocha with Istanbul andKarma, it is easy to track the code coverage of the application code when running the tests.

While Mocha has a built-in support for running the tests from the command-line via Node.js, in some cases you still want to verify your code with the real web browsers. The easiest way to do that with by using Karma to automatically launch the browsers, control them, and execute the tests. 

No comment yet.
Scoop.it!

Beryllium Work: Facebook Login with Javascript SDK, Angular.js and Rails

Many people try to integrate Facebook Login with their web apps. Facebook use OAuth 2.0 for authentication. There is omniauth gem for Rails to handle OAuth. To use Omniauth with Facebook, you need several gems: omniauth, omniauth-oauth2, omniauth-facebook. Though easier than before, you might still meet some problems here and there. Facebook provide Javascript SDK for client-side authentication. One important advantage of this approach is that Facebook maintain this SDK and it will always work. And communication for authentication happens between your browser (or mobile phone) and facebook server, which reduces the load of your web app. All you need is an access token from facebook. With the help of Facebook Javascript SDK, you do not need omniauth for authentication. While omniauth-faceook still provides some useful methods, they can be replace by fb_graph. 

No comment yet.
Scoop.it!

How to Unit Test Private Functions in The Revealing Module Pattern

How to Unit Test Private Functions in The Revealing Module Pattern | JavaScript for Line of Business Applications | Scoop.it
The Problem

Several patterns for structuring JavaScript code have been around over the past few years, chief of which are probably the module and the revealing module patterns. They both manage to cope with spaghetti code that seems to be a severe problem in large enterprise web applications. The advantages of these structuring patterns are priceless; and I’m not going to go through all of them. There are lots of nice articles describing these patterns and I would recommend you to read some if you’re not already aware of them. I would like, though, to point out one significant advantage; and that is the notion of encapsulation that we borrow from the object oriented programming.

In this article I will use the AMD pattern using requireJS. In Essence, AMD is an extension of the module and revealing module patterns, so it will suit the needs of our example.

No comment yet.
Scoop.it!

Managing Client-Side Objects Using TypeScript: It's a Breeze

Managing Client-Side Objects Using TypeScript: It's a Breeze | JavaScript for Line of Business Applications | Scoop.it
Once you've delivered server-side objects to your client, you're going to need to manage them. Here's how to integrate a powerful client-side (and server-side) object manager into your application using TypeScript.
No comment yet.
Scoop.it!

Inject: Dependency Management Got Awesome

Inject: Dependency Management Got Awesome | JavaScript for Line of Business Applications | Scoop.it

Inject (Apache Software License 2.0) is a revolutionary way to manage your dependencies in aLibrary Agnostic way. Some of its major features include:

* CommonJS Compliance in the Browser (module.exports.*)

* AMD Compliance for Library compatibility (define())

* Cross domain retrieval of files

* localStorage caching to reduce HTTP requests

Jan Hesse's insight:

http://engineering.linkedin.com/open-source/introducing-inject-open-source-javascript-dependency-management-library-browser

No comment yet.
Scoop.it!

Votr Part 5: AngularJS and CRUD Using RESTful APIs

Votr Part 5: AngularJS and CRUD Using RESTful APIs | JavaScript for Line of Business Applications | Scoop.it

This is the fifth and final part in a series of blog posts about building a real-time SMS and voice voting application using Node.js. I began working on this application during some downtime at a Startup Weekend event back in the summer of 2012. It was both an excuse to learn Node and build a reusable app for something that my team is often asked to provide at events (SMS voting). Let’s take a moment and recap where we’ve been.

In part one, we created the Node application and captured incoming votes over SMS and stored them in a CouchDB. I chose to use Express as the web framework and Cloudant and my CouchDB provider.

In part two, we created a real-time visualization of the voting using Socket.io and Highcharts. As votes came in a bar chart depicting the current state of the vote would update in realtime. For my purposes (live SMS voting at events) this was my MVP product. But at larger events I ran into some nasty scaling issues.

In part three, we tweaked our app to scale to thousands of votes per second and millions of total votes. This was accomplished by being smarter about how we stored our documents and leveraging CouchDB’s map/reduce capabilities.

In part four we began adding an web front-end for admins using AngularJS. We added AngularJS to our project and implemented a login and logout flow. We walked through the process of using CouchDB’s cookie-based authentication scheme to bootstrap a simple log-in process for our app.

The last thing for us to do to complete this admin portion of the application is to use AngularJS to create a simple CRUD interface for the events in our CouchDB. We will focus on the AngularJS code and templates that we’re going to write to edit our event documents and finish with a brief run-through of the server-side code.

No comment yet.
Scoop.it!

Emily Stark: Meteor - A Full Stack Framework For Building Pure JavaScript Apps

"Meteor is an open-source full-stack framework for building modern web applications. Apps written in this style -- like Google Plus and the photo browser in Facebook -- have rich and engaging interfaces because they send data over the network instead of HTML and run most of their code inside the browser. Meteor makes it possible to write applications this way in a fraction of the time, using a single language and unified API for all of your code. In this talk, I will live code a Meteor app from scratch, and dive into how some of Meteor's advanced features work under the hood, including reactivity, publications, subscriptions, and latency compensation."

No comment yet.
Scoop.it!

angular-ui-foundation: AngularJS Directives for Foundation

angular-ui-foundation: AngularJS Directives for Foundation | JavaScript for Line of Business Applications | Scoop.it

Provides directives specific for using Foundation with AngularJS. 

No comment yet.
Scoop.it!

Latte JS

Latte JS | JavaScript for Line of Business Applications | Scoop.it

Latte is a superset of JavaScript with lots of useful extensions. Get the power of CoffeeScript, but keep the syntax you know and love.

* Let Statement
* Functions
* Arrays
* Monads


No comment yet.
Scoop.it!

node.js & socket.io chat app with GeoLocation and User Agent support

node.js & socket.io chat app with GeoLocation and User Agent support | JavaScript for Line of Business Applications | Scoop.it

I constantly keep on updating the application and the code behind it and today it's time for another update. After a few hours of working on this I have not only added some new features but I have refactored some of my code as well as made the app look prettier (and I still can't call myself a designer)

Let's go through these new changes and enhancements now starting right off with the code changes to the backend.

I have started using the wonderful underscorejs.org library that provides functional programming support for JavaScript - it's especially useful when you do lot of operations on arrays and collections. Before, I was using code to manipulate collections that I either put together on my own or have copied from some other place. With underscore.js things got a lot simpler and neater. 

No comment yet.
Scoop.it!

A knockout plugin for restricting observables types and bind observables for automatic value type conversion

A knockout plugin for restricting observables types and bind observables for automatic value type conversion | JavaScript for Line of Business Applications | Scoop.it

Let's create an observable containing a moment object, then create a bounded converter to format the value using LL format (long date), for french culture (see moment doc for other formats).

Now whatever moment value you write to viewModel.date, viewModel.displayDate's value will be this moment converted to string. Of course, change notifications are propagated, which means that any subscriptions listening to viewModel.displayDate will be notified if viewModel.date changes.

But wait - there's more! Converter observables work both ways, so you can bind an input toviewModel.displayDate, and use the parsed value by reading viewModel.date.

When writing reusable modules, it might be a good idea in some circumstances to prevent users (that is, developers using your piece of code) from using the wrong type on the wrong observable. The type extender does this.


No comment yet.
Scoop.it!

Intro to Shadow DOM

Intro to Shadow DOM | JavaScript for Line of Business Applications | Scoop.it

The only existing solution that creates a boundary between the code you write and code that consumes, isugly – and operates by using a bulky and restrictive iFrame, which brings with itself another set of problems. So are we forced to adapt to this approach always?

Not anymore! Shadow DOM provides us an elegant way to overlay the normal DOM subtree with a special document fragment that contains another subtree of nodes, which are impregnable to scripts and styles. The interesting part is that it’s not something new! Various browsers have already been using this methodology to implement native widgets like date, sliders, audio, video players, etc.

No comment yet.
Scoop.it!

JavaScript: Async Promise "while loop"

JavaScript: Async Promise "while loop" | JavaScript for Line of Business Applications | Scoop.it

This is a solution to the situation where you have an asynchronous task you want to perform over and over again, in a non-blocking fashion, stopping when some condition is met.

To set the stage, I’ll be using the Bluebird Promise library, the best Promise library I’ve used.

First, we’ll construct the Promise function which will do the looping:...

No comment yet.
Scoop.it!

Want to Learn How to Code?

Want to Learn How to Code? | JavaScript for Line of Business Applications | Scoop.it

This week is Computer Science Education Week and even President Obama is helping out with the Hour of Code initiative. We know that a lot of people are thinking about trying to learn how to code (which is totally awesome). It is definitely not too late for anyone to learn, but most people have no idea where to even start. If this sounds familiar, this is the post for you. Since everyone needs a website or has an app idea, the focus of this post is on programming languages that can be used for web or mobile app development

First, what is front-end vs. back-end development? Front-end web development describes the visual, user-friendly layer of the website that the user interacts with and is used to collect inputs. Back-end web development uses the inputs that come from the front-end and is composed of servers, applications, and databases. Information is stored by the application in the database, which lives on the server. Mobile development incorporates both front- and back-end development components, but is mostly front-end.

A great analogy from a General Assembly front-end developer explains that if a website is a car, then the internal components of the car that you can’t see, but that make it run would be the back-end and the things you can touch/use/hear to make the car move or that make it cool/fun are the front-end.

Let’s dive in to the fun part, what are the best tutorials to use to learn how to code?

No comment yet.
Scoop.it!

Backbone or Angular or Ember? Here is my choice and why

Backbone or Angular or Ember? Here is my choice and why | JavaScript for Line of Business Applications | Scoop.it

I’ve spent the last year neck deep in the main MVC / MV* whatever frameworks for Javascript. It  was a very hard choice to pick a favorite and stick with it. I started out with Backbone, moved on to Angular and finally settled on Ember. This convoluted process is the reason I haven’t blogged in a few months, I really had to pick what client-side framework to blog about. This is my reasoning...

Amit Das's curator insight, January 3, 2014 12:59 AM

So tough to choose a MV*

Scoop.it!

An Overview of JavaScript Promises

An Overview of JavaScript Promises | JavaScript for Line of Business Applications | Scoop.it

Well, this has come like a Christmas gift to all JavaScript developers. You will be glad to know that Promises are now a part of standard JavaScript. Chrome 32 beta has already implemented the basic Promise API. The concept of Promises is not new to web development. Many of us have already used Promises in the form of several JS libraries such as Q, when, RSVP.js, etc. Even jQuery has something called Deferred which is similar to a Promise. But having native support for Promises in JavaScript is really amazing. This tutorial will cover the basics of Promises and show how you can leverage them in your JS development.

Jan Hesse's insight:

http://www.sitepoint.com/deeper-dive-javascript-promises/

No comment yet.
Scoop.it!

A slice of React, Clojurescript and Om

A slice of React, Clojurescript and Om | JavaScript for Line of Business Applications | Scoop.it

React has sparked a lot of interest in the Clojure community lately (and perhaps, hopefully the other way around as well), and for good reasons. At the very core, React lets you build up your DOM representation in a functional fashion by composing pure functions and you have a simple building block for everything: React components.

The core idea in Om is to simplify idiomatic state management with Clojurescript’s immutable datastructures, while still getting all the performance (and more), as well as adding some syntactic sugar.

I going to take a piece of the React tutorial and present in first Javascript, then Clojurescript and lastly using Om. Hopefully this will let us discover how plain Clojurescript interacts with React and inform us on some of the design decisions in Om.

No comment yet.
Scoop.it!

Managing the Asynchronous Nature of Node.js

Managing the Asynchronous Nature of Node.js | JavaScript for Line of Business Applications | Scoop.it

Node.js allows you to create apps fast and easily. But due to its asynchronous nature, it may be hard to write readable and manageable code. In this article I’ll show you a few tips on how to achieve that.


Solution 1: Callback Naming and Modularization
Solution 2: Promises
Solution 3: Step Library

 

As you can see, the asynchronous nature of Node.js can be managed and the callback hell can be avoided. I’m personally using the modularization approach, because I like to have my code well structured. I hope these tips will help you to write your code more readable and debug your scripts easier.

No comment yet.
Scoop.it!

45 Useful JavaScript Tips, Tricks and Best Practices

45 Useful JavaScript Tips, Tricks and Best Practices | JavaScript for Line of Business Applications | Scoop.it

As you know, JavaScript is the number one programming language in the world, the language of the web, of mobile hybrid apps (like PhoneGap or Appcelerator), of the server side (like NodeJS or Wakanda) and has many other implementations. It’s also the starting point for many new developers to the world of programming, as it can be used to display a simple alert in the web browser but also to control a robot (using nodebot, ornodruino). The developers who master JavaScript and write organized and performant code have become the most sought after in the job market.

In this article, I’ll share a set of JavaScript tips, tricks and best practices that should be known by all JavaScript developers regardless of their browser/engine or the SSJS (Server Side JavaScript) interpreter.

No comment yet.
Scoop.it!

Ko.Ninja Part 1 - A Framework For Building Awesome Knockout.js Apps

Ko.Ninja Part 1 - A Framework For Building Awesome Knockout.js Apps | JavaScript for Line of Business Applications | Scoop.it

Over the past year, I have been doing a ton of work on Knockout applications. There is a lot to love about Knockout. The declarative bindings allow you to keep your UI data-driven and synced at all times, which is a huge win when you are working on large scalable applications. However, one place where the Knockout core is lacking is that it is not prescriptive about how code should be written for it. That was the beginning of the idea behind ko.ninja. If we could put some structure around our viewModels, we could do some really cool things.

Ko.ninja is a collaborative open-source project written by Jonathan Creamer and myself. It is still in its infancy, and I would really like to get some feedback about tweaks and improvements that could be made to make it more awesome.

No comment yet.
Scoop.it!

Frontend components in React

Frontend components in React | JavaScript for Line of Business Applications | Scoop.it

Last week I made a presentation for meet.js PL about React. meet.js is a free front-end meetup organized by web enthusiasts in 6 major Polish cities - Warsaw, Gdańsk, Poznań, Wrocław, Cracow and Katowice.

In a nutshell, I presented why we chose React among other available options (ember.js, angular, backbone ...) in AgFlow, where I’m leading an application development.

Also I try to highlight some problems with MVC pattern everywhere.

I really like a way of React frontend components development. It makes more clear for us to implement use cases views.

Enjoy! 

No comment yet.
Scoop.it!

Dynamically Generating CSS with Ember.js and Rails

Dynamically Generating CSS with Ember.js and Rails | JavaScript for Line of Business Applications | Scoop.it

I’m currently working on an Ember.js app that requires the color scheme to be customizable to match the branding of our client’s clients. Since our application’s CSS is being compiled by the Rails Asset Pipeline, and the colors would be fetched over an API call, this posed an interesting challenge.

Originally, there were many unknowns around how we would accomplish this. How would we recompile our SCSS? Would we wrap the Ember app under a Rails route that would insert customized CSS on the page? If we loaded the CSS via Ember, how would we insert it on the DOM?

No comment yet.
Scoop.it!

Don't optimise JavaScript

In modern browsers, JavaScript is rarely the cause of slow applications. There are many layers involved in web applications that are way slower.

The first thing to do is to investigate to find out where the performance issue is coming from. The causes can be multiple:

* Relying too much on the connexion

* Extensive DOM manipulation

* Rendering issues (forced layout...)

* io (e.g. repeated usage of localStorage)

Use the Network tab of your favourite browser's development tool. Make sure your requests don't have any impact on your application at start and run time. Repeated Ajax calls can slow down applications too.

Identifying slow DOM manipulation is a bit harder. The Timeline tab of Chrome's dev tools can help you pinpointing such issues. Of course, you must get familiar with the best practices. For example, when rendering a list of items in a templating engine, move the loop to the template and append all items to the DOM in one operation.

Rendering issues can also be captured by Chrome's dev tools and starting from version 27, Firefox can now log functions that trigger a reflow!

There are a lot of valuable resources on the net about how to track down and fix these issues, so I won't cover them here. Once fixed, your application should work smoother. Not the case with yours? Keep reading then.

No comment yet.
Scoop.it!

LocalePlanet API

LocalePlanet API | JavaScript for Line of Business Applications | Scoop.it

When I started to localize an application with a lot of client-side JavaScript code, I discovered the truth about localization in JavaScript: there is none.

LocalePlanet is the library and procedures that I came up with to add it.

No comment yet.
Scoop.it!

NgReact.js - React Components in Angular

Facebook's React library is designed to be used as a view component atop other JavaScript frameworks. NgReact is a pair of proof of concept directives that show how React can cooperate with Angular, resulting in performance gains nearly up to 70% (or, well, losses up to 450%).

No comment yet.