JavaScript for Line of Business Applications
606.6K views | +12 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!

And just like that Grunt and RequireJS are out, it's all about Gulp and Browserify now

And just like that Grunt and RequireJS are out, it's all about Gulp and Browserify now | JavaScript for Line of Business Applications | Scoop.it

In a demonstration of how insane the Javascript world is, a revolution happened last week and it looks like Grunt was dethroned as the go-to task -runner. But wait you may say, wasn’t the Node and Grunt revolution just beginning? After all Grunt had just managed to find its way to job descriptions. Apparently we weren’t done revolutionizing.

And what I saw was that it is indeed much better, much more intuitive to Node.js devs and simpler to use. And that concluded it for me.

So now  instead of Grunt’s harder to understand syntaxes and laborious pre-config, we have this...

No comment yet.
Scoop.it!

Ember Components: A Deep Dive

Ember Components: A Deep Dive | JavaScript for Line of Business Applications | Scoop.it

Ember components are based on of the W3C Web Components specification. The specification is comprised of four smaller specifications; templates, decorators, shadow DOM, and custom elements. Of these four concepts only three of them have harden specifications, decorators being the exception. By having the specifications in place, framework developers have been able to polyfill these new APIs prior to them being implemented by browser vendors.

Web Components provide true encapsulation for UI widgets. Below is a diagram of how a component works at the most basic level.

While Ember has successfully polyfilled a lot of a specification, frameworks like AngularJS, Dart, Polymer, and Xtags have similar solutions. The only caveat here is that Ember and Angular currently don’t scope styles to the component. Over time, these polyfill solutions will fade away, and frameworks will adopt the browser vendor’s implementation. This is a fundamentally different approach to development, as we can take advantage of future specifications without tying ourselves to experimental features in browsers.

No comment yet.
Scoop.it!

Refactoring your JavaScript code with Grasp | Grasp - JavaScript structural search, replace, and refactor

There’s more to programming than just writing code. While unlikely, it is possible to write imperfect code the first time through, or have requirements change over time. In these cases, you have to refactor the code you’ve already written to fix mistakes and change functionality.

You can go about refactoring your code in several ways; a small change can be done manually, but a larger change requires a tool to automate the task. Many programmers use regular expressions to modify their code - but are they the best choice? Programs such as sed that use regular expressions view your code as simply a blob of text - it’s 2014, we can do better than that!

Grasp is a command line utility that allows you to search and replace your JavaScript code, with one important distinctive feature: it searches the structure behind your code (the abstract syntax tree), rather than simply the text you’ve written. That means Grasp is smart! It knows the difference between an if statement and an identifier, and it knows what parts make up those nodes (eg. an if statement has a test, a consequent, and optionally an alternative - the else). It combines this with an easy to understand syntax for searching and replacing, making it an incredibly powerful tool for refactoring your JavaScript code.

No comment yet.
Scoop.it!

Ember.js - Creating a Custom #link-to Handlebars Helper

Ember.js - Creating a Custom #link-to Handlebars Helper | JavaScript for Line of Business Applications | Scoop.it

Ember’s routing is arguably the best feature of ember. Recently while using amazon’s S3 file storage web interface where the tree like structure of buckets or folders is all done client side, I was frustrated to find that the url does not change as you navigate from bucket to bucket so you cannot link to a specific bucket or if you refresh the page, you are back at the root bucket. With ember, you have the ability to make every location on your site linkable thanks to ember’s execellent routing and the {{link-to}} helper is a nice convenience that takes a resource and returns a url to that resource.

No comment yet.
Scoop.it!

Recipes with Angular.js

Recipes with Angular.js | JavaScript for Line of Business Applications | Scoop.it

A community project dedicated to collecting resources for the Angular.js framework. You find here easy to follow cookbook style recipes for issues you are likely to face when working with Angular.js.

No comment yet.
Scoop.it!

Building a Single Page Application with AngularJS and Neo4J - Setup

Building a Single Page Application with AngularJS and Neo4J - Setup | JavaScript for Line of Business Applications | Scoop.it

In this section I will list all the steps that I had to go through to get my Mac ready for coding with the stack I picked. Hopefully this will be a useful timesaver for anyone who decided to do the same. If you found this page first, you won’t have to do any research. Just follow my footsteps and within minutes (not including the hefty download of Apple’s Xcode) you will be up and running, ready for action :)


When building a Single Page Application with AngularJS, we are going to be building essentially two pieces:

* The client, with all the JavaScript, HTML, CSS and various asset files needed for the front-end side of the application to run on the client machine’s browser.
* The server, with all the JavaScript files required to run the web server on top of Express/Node.js, which will serve the client application requests (GETs, POSTs, PUTs, etc.), connecting the client to the Neo4J persistence layer.

No comment yet.
Scoop.it!

Cordova/PhoneGap Tutorial

I needed a small app to play with phonegap and last time I wrote the simple note application in AngularJS immediately I start converting it to a phonegap application, which wasn’t that hard.

The source code is almost the same as the webapp version that I put in my last blog post, except a few changes that i’m going to explain now !!

Jan Hesse's insight:
http://danialk.github.io/blog/2013/12/17/angularjs-note-application/
No comment yet.
Scoop.it!

React beginner tutorial: implementing the board game Go

React is “a javascript library for building user interfaces”. If you haven’t done so already, I highly recommend you watch Pete Hunt’s presentationon React’s design principles. React is a relatively simple library, especially when compared to full-fledged MVC frameworks like Angular, Ember, Backbone, and the rest. It’s a pleasure to work with, so let’s get started.

Today, we’ll be implementing the board game Go. If you don’t know how to play, that’s okay. All you need to know for now is that players alternate placing stones on intersections of the board’s grid to capture their opponent’s stones and claim the greatest amount of territory. Take a look at the live preview to get an idea of what we’ll be building.

No comment yet.
Scoop.it!

Writing AngularJS with ClojureScript and Purnam

Hunting around for details on how to integrate AngularJS with ClojureScript, I did find a few articles, but eventually I came across the library Purnam, and I knew I had a winner. Purnam is a few things wrapped up into one:
* A very nice extra layer for JavaScript interoperability above and beyond what ClojureScript gives you out of the box
* Both a Jasmine and Midje style test framework, with integration into the great Karma test runner
* ClojureScript implementations of AngularJS directives, controllers, services, etcetera which greatly reduce the amount of boilerplate code you would otherwise need
* ClojureScript implementations that make testing of AngularJS directives, controllers, services, etcetera a breeze to set up under the above test framework.
* Fantastic documentation.

No comment yet.
Scoop.it!

EmberJS vs AngularJS : performance testing

EmberJS vs AngularJS : performance testing | JavaScript for Line of Business Applications | Scoop.it

 

Performance testing is really a tough task. If the matter was to compare ember and angular, with their given features, simplicity or number of lines in the code, it really become simple as it atleast has a platform. But measuring performance depends on browser, number of environmental factors, data transfer, type of your app, code quality, logic and much more. And the judgement factors are simply the speed and accuracy. But it’s really a variable thing to judge, as the test cases play their roles.

Today with few chosen test cases I would like to show you the visible difference between ember and angular. How according to implementation cases their behavior changes, how they exactly works and these things will help you to choose the right one between ember and angular  for your application.

No comment yet.
Scoop.it!

sailsCasts - Learning about sails.js one screencast at a time

sailsCasts - Learning about sails.js one screencast at a time | JavaScript for Line of Business Applications | Scoop.it
Building a Sails Application in 26 Episodes:

* Installing Sails and Create Initial Project
* Creating a sign-up page, ‘first-look’ at routes, and adding twitter bootstrap.
* Creating a user model and controller
* Creating a user account
* handling validation errors with a flash message
* Creating a policy and adding client-side validation
* Adding a show action (a.k.a. a Profile Page
* Building an admin page.
* Deleting a user account.
* Changing databases to mongoDB with sails adapters.
* Encrypting passwords with bcrypt.
* Starting a project in the middle using git clone.
* Sign-in page, session controller, new action, and sessions.
* User authentication and restricting access through policies.
* Improving user authenticated navigation.
* Fixing and issue with policies from episode 14.
* Creating a distinction between admin and regular users
* Understanding Web sockets and socket IO including room creation and management
* Create the necessary ui and mechanics for sign-in and sign-out in preparation for using web sockets.
* Adding real-time events to models in 4 lines of code
* Marshalling request parameters
* Integrating socket.io and sails with custom controller actions using Real Time Model Events.
* Manipulating the DOM based upon changes via Real Time Model Events.
* Adding real-time flash messages using real-time model events.
* Correcting a publishUpdate event and adding a policy to the user controller’s subscribe action
* What is CommonJS in relation to node? What does it do? How do I use it?
* Deploying a sails app to Heroku.

No comment yet.
Scoop.it!

Working With IndexedDB – Part 3

Working With IndexedDB – Part 3 | JavaScript for Line of Business Applications | Scoop.it
Welcome to the final part of my IndexedDB series. When I began this series my intent was to explain a technology that is not always the most… friendly one to work with. In fact, when I first tried working with IndexedDB, last year, my initial reaction was somewhat negative (“Somewhat negative” much like the Universe is “somewhat old.”). It’s been a long journey, but I finally feel somewhat comfortable working with IndexedDB and I respect what it allows. It is still a technology that can’t be used everywhere (it sadly missed being added to iOS7), but I truly believe it is a technology folks can learn and make use of today.

In this final article, we’re going to demonstrate some additional concepts that build upon the “full” demo we built in the last article. To be clear, you must be caught up on the series or this entry will be difficult to follow, so you may also want to check out part one.

No comment yet.
Scoop.it!

The AngularJs Promise Anti-Pattern That Makes Me Cry

Asynchronous interactions in AngularJs are built on promises. A lot has been said on the subject of promises already. So I won’t cover their purpose extensively here. Long story short, use them.

Sadly enough, the reasons for using promises are still widely misunderstood. One pattern, in particular, I still see quite often with new users of promises. I don’t have a cool name for it, but if I did, it would be: “The AngularJs promise anti-pattern that makes me cry.” But that’s just because I’m over-dramatic.

In general, I’ve seen this pattern in the following form...

No comment yet.
Scoop.it!

Taming node.js callbacks with caolan/async

Lately I've started dabbling in node.js development. I am developing a rest service api for a windows phone 8 application. Soon enough I noticed that my request handlers have too many nested callbacks.

My requirements were that it must be easy to pass the result of one function to the next one, no weird wrapping functions in other functions return deferreds and promises and whatever.

After googling around a bit, i found a few async libraries built for javascript like caolan/async, q and many others. I couldn't wrap my head around how they work, i couldn't find any real life eamples only useless tutorial examples.

So after a while i decide to use https://github.com/caolan/async#waterfall. Why? You can use any function with it, it is easy to pass the results to the next function and no wrapping non-promise functions. And I've been already using it's array manipulation functions already.

So what did it bring me? A few examples...

No comment yet.
Scoop.it!

Stop Writing JavaScript Compilers! Make Macros Instead

Stop Writing JavaScript Compilers! Make Macros Instead | JavaScript for Line of Business Applications | Scoop.it

This post is not a tutorial on JavaScript macros. This post intends to explain how they could radically improve JavaScript's evolution. But I think I need to provide a little meat first for people who have never seen macros before.

Macros for languages that have a lot of special syntax take advantage of pattern matching. The idea is that you define a macro with a name and a list of patterns. Whenever that name is invoked, at compile-time the code is matched and expanded.

Jan Hesse's insight:

http://jlongster.com/Writing-Your-First-Sweet.js-Macro

http://jlongster.com/Sweet.js-Tutorial--2--Recursive-Macros-and-Custom-Pattern-Classes

No comment yet.
Scoop.it!

ECMAScript 6: merging objects via Object.assign()

ECMAScript 6: merging objects via Object.assign() | JavaScript for Line of Business Applications | Scoop.it

Copying all properties of one object to another one is a common operation in JavaScript. This blog post explains ECMAScript 6’s implementation of it, which is calledObject.assign().

This merging operation has a name in the JavaScript ecosystem that is only used there (and, unfortunately, clashes with classic OOP terminology): “extend”. 

This function copies all enumerable [1] own operties from source to target. It returns the (modified) target. The exact signature of the function is still being debated, there may eventually be support for more than one source. 

No comment yet.
Scoop.it!

Tracking changes to complex viewmodels with Knockout.JS

Tracking changes to complex viewmodels with Knockout.JS | JavaScript for Line of Business Applications | Scoop.it

As part of a project I’ve been working on for a client, we’ve decided to implement HTTP PATCH in our API for making changes. The main client consuming the API is a web application driven by Knockout.JS, so this meant we had to find a way to figure out what had changed on our view model, and then send just those values over the wire.

There is nothing new or exciting about this requirement in itself. The question has been posed before  and it was the subject of a blog post way back in 2011 byRyan Niemeyer. What was quite exciting however was that our solution ended up doing much more than just detect changes to viewmodels. We needed to keep tabs on individual property changes, changes to arrays (adds\deletes\modifications), changes to child objects and even changes to child objects nested within arrays. The result was a complete change tracking implementation for knockout that can process not just one object but a complete object graph.

In this two part post I’ll attempt to share the code, the research and the story of how we arrived at the final implementation.

No comment yet.
Scoop.it!

Building a SPA with AngularJS and Neo4J - Data Structure (Second Try)

Building a SPA with AngularJS and Neo4J - Data Structure (Second Try) | JavaScript for Line of Business Applications | Scoop.it

At the end of last post I quoted the eye-opening comment that Graph Grandmaster Wes Freeman left on one of my questionson Stack Overflow. Following his advice I decided to change the way each of the queues in my application was handled, adding two extra nodes, the head and the tail.

 

I am very satisfied with how much simpler the new queries are, both to write and to understand, when compared to the older one discussed in the previous post of this series. At this point Wes suggested to run some performance tests. The results can be found below. Not much of a difference from a performance point of view – especially because this was an end-to-end performance test, calling N times the server, executing one insertion/archival at a time.

No comment yet.
Scoop.it!

AngularDart for AngularJS Developers. Introduction to the best Angular yet.

AngularDart for AngularJS Developers. Introduction to the best Angular yet. | JavaScript for Line of Business Applications | Scoop.it

AngularDart is a port of the acclaimed framework to the Dart platform. It is being developed by the Angular core team. In this article I will compare the Dart and JS versions of the framework. In particular, I will look into dependency injection, directives, and digesting.

The article is written for:

* Dart developers who have some experience with AngularJS.
* AngularJS developers thinking about trying out AngularDart.
* AngularJS developers who are not going to switch to Dart, but want to know more about the future of the framework. * According to Angular folks, many of AngularDart’s features will be ported to AngularJS at some point. So learning about the Dart version of the framework can be interesting, even if you are not planning to use it.

No comment yet.
Scoop.it!

Cookies vs Tokens. Getting auth right with Angular.JS

Cookies vs Tokens. Getting auth right with Angular.JS | JavaScript for Line of Business Applications | Scoop.it

There are basically two different ways of implementing server side authentication for apps with a frontend and an API:

* The most adopted one, is Cookie-Based Authentication (you can find an example here) that uses server side cookies to authenticate the user on every request.

* A newer approach, Token-Based Authentication, relies on a signed token that is sent to the server on each request.

No comment yet.
Scoop.it!

AngularJS Service / Factory Tutorial. AngularJS service examples

AngularJS Service / Factory Tutorial. AngularJS service examples | JavaScript for Line of Business Applications | Scoop.it

Putting business and other logic within services has many advantages. First it fulfills the principle of separation of concern or segregation of duties. Each component is responsible for its own work making application more manageable. Second this way each component can be more testable. AngularJS provides first class support for unit testing. Thus we can quickly write tests for our services making them robust and less error prone.

 

Consider above diagram. Here we divide our application in two controllers: 1. Profile and 2. Dashboard. Each of these controllers require certain user data from server. Thus instead of repeating the logic to fetch data from server in each controller, we create a User service which hides the complexity. AngularJS automatically inject User service in both Profile and Dashboard controller. Thus our application becomes for modular and testable.

No comment yet.
Scoop.it!

AngularJS Highlights: Best of 2013

With 2014 set to be the year of AngularJS, now is the time to get up to speed with all the great AngularJS resources from 2013. Only the best have made it onto this list. Here are the top picks for 2013:

* Learning AngularJS
* Applications with AngularJS
* Directives
* AngularJS Games
* AngularJS Workflow and Testing
* AngularJS Books

No comment yet.
Scoop.it!

How I use custom validation messages in Sails.js

How I use custom validation messages in Sails.js | JavaScript for Line of Business Applications | Scoop.it

When I started building a twitter clone in Sails.js, I noticed the model validation messages being thrown by the framework are not user friendly. So I wanted to provide custom validation messages but unfortunately, if I'm not mistaken, Sails doesn't currently support it because of the limitation of Anchor which is the validator used by Sails.

No comment yet.
Scoop.it!

Create a Sails.js live chat

In this screencast, you will learn how to create a live chat system based on the Sails.js framework.

During his hour and a half talk, Mike McNeil will teach you how to use his framework and how to develop an entire live chat system.

I hope you will enjoy his presentation.

No comment yet.
Scoop.it!

ngDialog.js - Modals and popups provider for Angular.js applications

Modal dialogs and popups provider for Angular.js applications.

ngDialog is small (~2Kb), has minimalistic API, highly customizable through themes and has only Angular.js as dependency.

ngDialog service provides easy to use and minimalistic API, but in the same time it's powerful enough. 

No comment yet.