JavaScript for Line of Business Applications
596.1K views | +0 today
Follow
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

Current selected tag: 'ES6'. Clear
Scoop.it!

Functions that yield multiple times

Functions that yield multiple times | JavaScript for Line of Business Applications | Scoop.it

I recently introduced you to JavaScript generators which I think are a really interesting feature that we should look at for the future of JavaScript. In that blog post I was talking about LINQ in JavaScript and kind of glanced over an important part of generators, and that's how you use them if you're not using a for-of loop. While generators make a lot of sense in the scope of managing datasets that isn't their only usage, in reality generators are quite useful if you want to lazily execute any function.

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!

Experiments with Koa and JavaScript Generators

Koa is a new application framework for Node.js. Its whole point is to eliminate the callback madness that plagues many Node.js apps. It achieves this previously-impossible feat by using the powerful generators feature which is new in JavaScript ES6. Koa is built by the same people who created Express, the best-known Node.js application framework, so it’s at least worth a look.

Having written plenty of callback-heavy JavaScript, I was excited to give this thing a go and see how much simpler it could make my code.

This blog post is purely about generators and async in Koa. If you want to actually build an app with Koa, go and read the framework’s website. If you’ve never used Express (the earlier incarnation of Koa’s ideas) then be sure to learn aboutmiddleware, the central architectural pattern in Koa, so you will see how the framework intends your application to be organised.

No comment yet.
Scoop.it!

ES6 modules and EmberJS : a taste of the future

ES6 modules and EmberJS : a taste of the future | JavaScript for Line of Business Applications | Scoop.it

A quick walk throught the fresh ES6 modules spec coupled with the front MVC framework EmberJS.

The ES.current as we know it doesn’t feature a standardized module system, you cannot require some fragment of code inside another fragment of code and use it while being inside a namespace (and not a global). AMD and CommonJS came along and proposed two impressive yet incompatible solutions to let developers use modules (AMD is mostly used in the browser, while CommonJS is more used server-side). The new ES6 modules spec aims at solving this module problem and also let ES6 modules transpile to both AMD and CommonJS as a polyfill.

The ES6 modules spec is done and will not change before the ES6 specs release, we can now use it and feel safe about the new semantic we learn.

Jan Hesse's insight:

http://thau.me/2013/12/es6-modules-and-emberjs-a-taste-of-the-future-part-2/

No comment yet.
Scoop.it!

Play, Scala, and Iteratees vs. Node.js, JavaScript, and Socket.io

Play, Scala, and Iteratees vs. Node.js, JavaScript, and Socket.io | JavaScript for Line of Business Applications | Scoop.it

The Play Framework takes a functional programming approach to stream processing (e.g. Comet, chunked responses, WebSockets) by using abstractions called Iteratees, Enumerators, and Enumeratees. When I originally tried to wrap my head around Iteratees, I found that the existing documentation and sample apps were fairly confusing and ineffective for getting started. Since teaching is often the best way to learn, I decided to write a blog post as a way to become more comfortable with functional I/O.

On the JavaScript side of the world, node.js and socket.io take an imperative programming approach for stream processing by using the EventEmitter API. I've found this imperative approach easy to learn, so for this blog post, I'll show a side by side comparison of the imperative and functional techniques for each example. The focus of the post will be on WebSockets, including a basic "hello world" example, an echo server, and a simple chat application.

No comment yet.
Scoop.it!

ECMAScript 6 modules in future browsers

ECMAScript 6 modules in future browsers | JavaScript for Line of Business Applications | Scoop.it

This an introduction to ECMAScript 6 modules and how they can be used in current browsers. In contrast, this blog post explains how future browsers will support them natively. As part of that support, we will get the <module> tag, a much better version of the <script> tag.

The main advantages of ECMAScript 6 modules compared to current module systems are: Their syntax is more elegant (than even Node.js modules), they work both synchronously and asynchronously (without an extra compilation step), and they unify the JavaScript module landscape.

No comment yet.
Scoop.it!

What's the Big Deal with Generators?

What's the Big Deal with Generators? | JavaScript for Line of Business Applications | Scoop.it

In this post I'm going to attempt to explain what exactly generators are and why their addition is such a big deal in JavaScript (and more particularly, Node). 

While generators themselves aren't overly complex, some of the concepts relevant to them aren't exactly common knowledge, so bear with me while we set some context.

No comment yet.
Scoop.it!

wu.js - A lazy, functional Javascript library that ain't nuthin' ta f*ck wit.

Wu.js is a library for lazy, functional programming in Javascript. Works great in the browser, and also with CommonJS (including node and Narwhal).

The largest part of wu is dedicated to iterators. Iterators are lazy sequences with a number of methods that encourage functional programming. What does it mean to be lazy? Many people might expect the following code to log "1 squared is 1", "2 squared is 4", and "3 squared is 9" immediately.

wu([1,2,3]).map(function (n) { console.log(n + " squared is " + (n*n)); return n*n; });

However, nothing is logged. Because iterators are lazy, you must explicitly ask for an item and force evaluation. As you ask for items from this iterator, the messages will come one by one.

No comment yet.
Scoop.it!

Javascript Modules, AMD, and the road ahead.

Javascript Modules, AMD, and the road ahead. | JavaScript for Line of Business Applications | Scoop.it

There are many design patterns used in Javascript and I would recommend taking a look at Javascript Patterns by Stoyan Stefanov for a full introduction to the most widely used patterns. Of the design patterns available, the Module pattern has gotten the most recognition in the past few years thanks in part to the maturation of the module pattern via commonjs as well as the wild success of node.js.

 

The Module Pattern

In a nutshell the module pattern allows you to create code that can expose a public API while safe guarding private variables and methods behind a pseudo blackbox.

 

The future looks bright

We’ve looked at the basic Module pattern and seen how to use it to create some really powerful Javascript. We then took a look at how AMD works and how we could easily change our code to build our modules following the Commonjs specification for asynchronous modules, lastly we took a look at the bleeding edge harmony modules specification. I find that it is easy to see the beauty of where ECMAscript 6 is heading, with respect to modules, when you take a look back at where we’ve already been and how we’ve evolved up to this point.

No comment yet.
Scoop.it!

ECMA5 approach to building JavaScript frameworks

ECMA5 has given JavaScript a number of new ways to define and manipulate objects. In this session, attendees will learn how to combine Require.js and ECMA5’s object manipulation functions to create an inheritance model similar to class-based languages.

No comment yet.
Scoop.it!

The ECMAScript Internationalization API

The ECMAScript Internationalization API | JavaScript for Line of Business Applications | Scoop.it

The ECMAScript Internationalization API is a standard JavaScript API that helps with tasks related to internationalization: collation, number formatting, date and time formatting. This blog post gives a brief overview and points to more reading material.

The specification of the ECMAScript Internationalization API is edited by Norbert Lindenberg. It is available in the formats PDF, HTML and EPUB. Additionally, there are several comprehensive introductory articles...

* Collation
* Number formatting
* Date and time formatting


No comment yet.
Scoop.it!

Fat Arrow Functions in JavaScript

Fat Arrow Functions in JavaScript | JavaScript for Line of Business Applications | Scoop.it

Since sometime back in the heady days of Firefox 22, Firefox gained the ability to use Fat Arrow Functions in JavaScript. Users of CoffeeScript (or, I guess, C#) will be familiar with the syntax. We’ve been using these in Firefox DevTools code for nearly 6 months.

You can use them today in any shipping Firefox and experiment with them live in theScratchpad or Console.

They look like this:

let x = (args) => { /* some function gunk */ };

If you want to call it, you can with x();

Fat Arrow functions have a couple of interesting properties. First and probably most useful is that they gain the scope of the environment they’re defined in. You can’t change the value of this by using a call() or bind() function.

Second, Fat Arrow functions don’t have their own prototype or a constructor. (They have the standard Function prototype). This means trying to use the new operator on a fat arrow function results in a TypeError.

That’s all well and good, but what is the practical application of all of this? ...

No comment yet.
Scoop.it!

Eight Cool Features Coming in ES6

Eight Cool Features Coming in ES6 | JavaScript for Line of Business Applications | Scoop.it

ES6 is coming and with it brings many great things that will help us develop better and faster web applications. Let’s have a look at the most significant ones.

In ES6 there is a lot of syntax sugar that will shorten development time and speed up our applications. Let’s have a taste, shall we?

Finally, ES is turning into a true object-oriented language. With the introduction of classes, we can write our code in a clean and structured way. It will remove the need for the current coded solutions present in nearly every popular library...

* Syntax Sugar
* Classes
* Modules
* Maps and Sets
* Iterators
* Weak Maps
* Proxies
* Template Strings
* Conclusion

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!

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!

JavaScript Promises: There and back again

JavaScript Promises: There and back again | JavaScript for Line of Business Applications | Scoop.it
What's all the fuss about?

JavaScript is single threaded, meaning that two bits of script cannot run at the same time, they have to run one after another. In browsers, JavaScript shares a thread with a load of other stuff. What that stuff is differs from browser to browser, but typically JavaScript is in the same queue as painting, updating styles, and handling user actions (such as highlighting text and interacting with form controls). Activity in one of these things delays the others.

 

* What's all the fuss about?
* Events aren't always the best way
* Promise terminology
* Promises arrive in JavaScript!
* Browser support & polyfill
* Compatibility with other libraries
* Complex async code made easier
* Promisifying XMLHttpRequest
* Chaining
* Error handling
* Parallelism and sequencing - Getting the best of both
* Promise API Reference

No comment yet.
Scoop.it!

Callbacks vs Coroutines

Callbacks vs Coroutines | JavaScript for Line of Business Applications | Scoop.it

There’s been a lot of arguing lately regarding a somewhat recent Google V8 patch providing the ES6 generators. While generators still sit behind the —harmony or —harmony-generators flags it’s enough to get your feet wet! In this post I want to go through my experiences with coroutines and why I personally think they’re a great tool.

Before getting into the difference between generators and coroutines let’s look what makes generators useful in environments like Node.js or the browser where callbacks dominate the ecosystem.

First off generators are complementary to callbacks, some form of callback is required to “feed” the generators. These “futures”, “thunks”, or “promises” — whatever you prefer to call them allow deferred execution of some logic, this is what you yield a value and allow the generator to handle the rest.

No comment yet.
Scoop.it!

10 Ecmascript-6 tricks you can perform right now

10 Ecmascript-6 tricks you can perform right now | JavaScript for Line of Business Applications | Scoop.it

We live in a fluid world. I first started hearing about HTML5 several years ago now, and I’ve been using it for at least two, yet it won’t be officially ready until next year at the earliest. While HTML is making great strides, another leg of the stool is progressing nicely as well. New Javascript features are coming, outlined in the standard known as Ecmascript 6. Though it’s not finalized, it is approaching stability and implementation is coming along in various forms.

You’ve probably heard about some of the cool features on the way, like module support, classes and a bunch of syntactic niceties, but you might not have had a chance to try them. 

No comment yet.
Scoop.it!

Taming asynchronous programming with Harmony

Taming asynchronous programming with Harmony | JavaScript for Line of Business Applications | Scoop.it

Chained is an experiment and a prototype library for Javascript I developed in the past weeks. It is meant to show a concept and to provide some limited but useful functionality. All the examples below are written in Coffeescript (and I guess that this makes me a hippie, right?).

Chained allows to chain functions explicitly — both those that return promises and those who don’t — without using then-based constructs.

No comment yet.
Scoop.it!

Living in the ES6 Future Today

Presentation of what upcoming JavaScript Standard "Harmony" will bring for developers and what shims you can use in the meantime.
* classes

* for ... of

* rest parameters

* arrow functions

* iterators

* generators

* destructuring

* unicode support

* block-scoped variables

* WeakMaps

* proxies

* spread operator

* and more

No comment yet.
Scoop.it!

Axel Rauschmayer: JavaScript inheritance: beyond the basics

After giving a brief overview of JavaScript inheritance basics, this talk delves into advanced topics and answers questions such as the following ones:

* What is the difference between constructor inheritance and instance inheritance?
* What is the property `constructor` about?
* How does the `instanceof` operator really work?
* How does one reference a super-property in JavaScript?
* What is the `__proto__` property? Does it have a future?
* Will JavaScript ever have classes? How would they work?
* How do I implement a type via an object instead of via a constructor function?

No comment yet.
Scoop.it!

es6 generators and iteration in spidermonkey

It is my great pleasure to announce that SpiderMonkey, the JavaScript engine of the Firefox browser, just got support for ES6 generators and iteration! As I have written before, generators are functions that can suspend. SpiderMonkey has had generators since Firefox 2 (really!), but the new thing is that now their generators are standard, and available by default. No need to futz with Firefox-specific "language versions".

Generators are a kind of coroutine, and coroutines work well for asynchronous computation. But that's not all that coroutines are good for. Another great application of generators is in iteration, where you have a producer that knows how to produce values, and a consumer that knows how to process them. Being able to write the producer as a coroutine is great win.


No comment yet.
Scoop.it!

The Future of AngularJS

The Future of AngularJS | JavaScript for Line of Business Applications | Scoop.it

Brian Ford shows the use of ES6 Modules and Web Components used by templates in AngularJS. Also it is shown how object.Observe could replace $apply.

No comment yet.
Scoop.it!

Writing Client-Side JavaScript Modules, AMD, RequireJS & the "wrapper" Module

Writing Client-Side JavaScript Modules, AMD, RequireJS & the "wrapper" Module | JavaScript for Line of Business Applications | Scoop.it

An often overlooked piece of JavaScript examples, tutorials and discussion is the writing of libraries/modules.

While there is a vibrant community of people writing UI centric jQuery Plugins with a de-facto style and methodology, paging through Github repositories of the many libraries, frameworks, plugins, etc will show an extremely disparate set of coding styles and methods.

 

History, ES6, Transpilers and AMD

 

As more and more browsers support experimental ES6 Module Features, and others use transpilers to write in ES6 transpiling to shim'd JavaScript/ECMAScript5 which export to AMD format & client-side JavaScript becomes even more complex and large, users will use module style coding as the standard.

Regardless of whether or not you want to support CommonJS, RequireJS/AMD or just write a library which aliases its' constructor or main method/object to the window: anyone could benefit from writing small, testable and compartmentalized modules.

No comment yet.
Scoop.it!

Exploring JavaScript prototypes via TypeScript’s class pattern

Exploring JavaScript prototypes via TypeScript’s class pattern | JavaScript for Line of Business Applications | Scoop.it

In this post, I’m going to take a close look at how JavaScript’s prototypal inheritance works by analysing how Microsoft’s TypeScript language uses it to provide a simple implementation of classes. Don’t worry if you’ve never used TypeScript, we’re not really concerned with the language itself here, just the JavaScript that is produced by its compiler, and how it achieves class-based inheritance in a language that doesn’t natively support it.

This is of particular importance because EcmaScript 6 will include classes that work a lot like TypeScript’s. The idea of adding classes to JavaScript is controversial, but I think some of the hostility stems from a mistaken belief that classes are some kind of competing inheritance mechanism to prototyping, or are an attempt to turn JavaScript into Java. In fact, modern proposals for classes in JavaScript are just a syntactic codification of prototypal inheritance patterns that are already in use.

No comment yet.