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 tags: 'React', 'reactive programming'. Clear
Scoop.it!

cans: A framework for building React MobX application

cans: A framework for building React MobX application | JavaScript for Line of Business Applications | Scoop.it

In my opinion, the best way to building web User Interface is separate the state and the UI. This is what Elm Architecture dose. It separates every elm program into Model, Update and View parts. It’s good. But I am not familiar with functional programming, so do many web UI developers.

Though I am not familiar with functional programming, I always learn a lot from it. I love FP because it is a good tool to write less bug and write more maintainable code. This is why I love React too. Every UI component can write as a function of state ((state) => UI), which let you test the UI more easy, just pass different state and expect the return value.

Using MobX and React means you get all of it. MobX will take care of the state, React will take care of the View render. And then my framework cans came out.

No comment yet.
Scoop.it!

Recycle — Truly Functional and Reactive way of writing React apps

Recycle — Truly Functional and Reactive way of writing React apps | JavaScript for Line of Business Applications | Scoop.it

One of the most popular FRP JavaScript framework today is — Cycle.js.

Although, Recycle uses React, its actually inspired with Cycle.js. Recycle initial version had nothing to do with React and was made as an “opinionated version of Cycle.js”.

But, as it turns out, defining components composed of a view, actions and functions responsible for modifying state is a model that can be described without the use of the main function, drivers or complex stream manipulations.

No comment yet.
Scoop.it!

Containers Are Dead. Long Live Observable Combinators

Containers Are Dead. Long Live Observable Combinators | JavaScript for Line of Business Applications | Scoop.it

I really like Cycle.js. It is simple and declarative. But it has two caveats. First it has hard RxJs dependency and that is too much: if I select a rendering library then I don’t want it to constrain my state handling! Second, Cycle’s DOM event subscription system is not practical (regardless how functional and “reactive” it may be): the emitted data must be encoded into DOM (e.g. by using data attributes like data-id=”myId”). Just ugly.

Single source of Truth. And its problems
The state of your whole application is stored in an object tree inside a single store.

That is a direct quote from Redux website. The most of the current Flux libraries use combined reducer and this has locked the developers’ mindsets to the fact that the state should be like a mega sized “blob” which is passed to the “dummy” components via props. And there is always an explicit layer which separates the state handling and the UI: the top level “application container”. Perhaps you’ve seen this kind of lines in Redux apps...

No comment yet.
Scoop.it!

Cerebral - an intelligent react application framework

Cerebral - an intelligent react application framework | JavaScript for Line of Business Applications | Scoop.it

Cerebral is a framework. It provides concepts for handling application state and depends on React for its UI. Routing, http requests etc. are separate tools you choose based on what the project needs. Technically Cerebral does not need React to work.

So why would you even consider Cerebral? Before going into the thoughts behind Cerebral I want to point out that this is not another “FLUX framework” with its own take on actions, dispatchers and stores. I am certainly not talking down those frameworks, many of them are really great, but Cerebral is a new take on how to handle application state alltogether. It is inspired by Flux and more recent solutions like Baobab. So big thanks to all the brilliant people working on tools to make web application development more fun than frustrating!

Core features

  • An architecture inspired by Flux and Baobab
  • A single object for all application state
  • One way flow of state
  • Has complete control of your application state flow using signals
  • Can retrace state changes live in the UI
  • Specific concepts for handling asynchronous code and relational data
  • Immutable data
  • A functional approach to interactions
  • Gives errors on invalid code
  • Requires React as your UI layer


Jan Hesse's insight:

https://github.com/christianalfoni/cerebral

No comment yet.
Scoop.it!

Reactive ReactJS: improving data flow using reactive streams

Reactive ReactJS: improving data flow using reactive streams | JavaScript for Line of Business Applications | Scoop.it
Many people that use ReactJS as their renderer are using some kind of the
Flux architecture to store data, react to actions and notify components
about changes. After a University project involving Scala and RxJava, I wanted
to use these ideas together with ReactJS views. Besides that I found two things
missing in the Flux architecture:

composing different kinds of data easily
interaction with the server

Of course there are ways to solve this, but perhaps reactive streams can help
ease these shortcomings.
No comment yet.
Scoop.it!

Good bye Flux, welcome Bacon/Rx?

Good bye Flux, welcome Bacon/Rx? | JavaScript for Line of Business Applications | Scoop.it

Facebook introduced Flux about a year ago for client-side web application building and since then it has become one of the hottest tech in the web development scene.

The task of Flux is to isolate business logic from the user interface logic by using dispatcher, stores and actions. The core idea is the unidirectional data flow which means that actions are propagated through the entire system in response to user interactions but they have no binding to the internal data model.

As the name implies, Reactive programming is what React is made for. Actions happen eventually and they propagate through the event streams.Combination of those event streams forms the application’s state. After the event has propagated through the system, the new application state object is consumed by the subscriber and rendered by the root level React component. This makes the data flow dead simple.

No comment yet.
Scoop.it!

Describing UI state with data

Describing UI state with data | JavaScript for Line of Business Applications | Scoop.it

n this post we build a small example UI following a data-first approach. What the user sees is just a representation of a piece of data, the app state. And when she interacts with the interface, she is just applying transformations to that piece of data.

No comment yet.
Scoop.it!

What is the Flux Application Architecture?

What is the Flux Application Architecture? - Brigade Engineering - Medium

Flux is an idea for organizing your application that was developed at Facebook, based on one simple principle:

Data moves in one direction through your application.

This is called “unidirectional data flow”, but it might be easier to remember if you think of your data as a shark: Sharks can only swim forward.

Facebook has published examples of Flux, and at least six other libraries have sprung up with interpretations. For the purpose of this article, when we say “Flux”, we are referring to the Facebook implementation.

No comment yet.
Scoop.it!

Functional Reactive React.js

Functional Reactive React.js | JavaScript for Line of Business Applications | Scoop.it
A brief journey into reactive interfaces with FRP and React.js

In this post, I will discuss the way we approach building interfaces with reactive programming and React, and how it’s changed the way we think about writing effective code. The first half will cover how we use reactive programming — RxJS, more specifically — to compose our data sources, and the second will talk about feeding that data into React.

No comment yet.
Scoop.it!

NuclearJS: Flux Architecture with Reactive, Immutable state modelling.

NuclearJS: Flux Architecture with Reactive, Immutable state modelling. | JavaScript for Line of Business Applications | Scoop.it

NuclearJS is an Immutable implementation of Flux Architecture. Nuclear provides a very decoupled solution to modelling state in a frontend system, leading to much thinner UI components, easier testability and more predictability. In fact, when done right, a Nuclear powered frontend will have ZERO state in UI components.

NuclearJS is UI framework agnostic. It pairs well with almost every popular UI framework, since its only concern is state modelling and provides a very pleasant and simple to use API.

No comment yet.
Scoop.it!

Build a MobX Example App in 4 Steps

Build a MobX Example App in 4 Steps | JavaScript for Line of Business Applications | Scoop.it
In this blog I will show you how to pick up an existing codebase example and curtail it into your own, beautiful MobX Example App built using React, MobX and the Cosmic JS API to create and remove…
No comment yet.
Scoop.it!

MobX - Simple, scalable state management

MobX - Simple, scalable state management | JavaScript for Line of Business Applications | Scoop.it

MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming (TFRP). The philosophy behind MobX is very simple:

Anything that can be derived from the application state, should be derived. Automatically.

which includes the UI, data serialization, server communication, etc.

MobX is inspired by reactive programming principles as found in spreadsheets. It is inspired by MVVM frameworks like in MeteorJS tracker, knockout and Vue.js. But MobX brings Transparent Functional Reactive Programming to the next level and provides a stand alone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.

No comment yet.
Scoop.it!

React, Redux and Immutable.js: Ingredients for Efficient Web Applications

Unlike most front-end web frameworks, React's aim is to solve the various challenges of building user interfaces that rely on changing data. Although React is a simple JavaScript library and is easy to get started with, it is still possible to misuse it in ways that deny the web app from reaping the benefits that React has to offer. In this article, Toptal engineer Ivan Rogic demonstrates the synergy of React, Redux and Immutable.js, and shows how these libraries together can solve many performance issues that are often encountered in large web applications.
No comment yet.
Scoop.it!

Isomorphic apps = normal React+FRP apps

Isomorphic apps = normal React+FRP apps | JavaScript for Line of Business Applications | Scoop.it

Isomorphic apps are almost like “normal” apps when creating them with the FRP. Because the FRP encourages you to always pass the entire state object to the rendering function, nothing prevents you to do the same in the backend as well.

If you have read other tutorials you may already know that React has a “backend-compatible” function called renderToString. It behaves exactly like render but doesn’t call componentDidMount and returns the rendered HTML as a string instead of placing it into a DOM node. Component & model in → HTML out. Couldn’t be simpler?

Well… actually, it could be. There are two gotchas you should know before trying to use renderToString:

  1. Your backend must understand JSX syntax
  2. Your front-end modules must be CommonJS compatible
No comment yet.
Scoop.it!

Announcing Arch - a functional style application framework for React

Announcing Arch - a functional style application framework for React | JavaScript for Line of Business Applications | Scoop.it

Arch is a front-end functional style application framework using React as a UI layer. Arch applications are isomorphic out of the box, including form processing. This means you write your application as if it was client-side only and Arch will manage the server-side portion.

This also means you don’t get any control over the code running server-side, which is a design decision. The theory behind it is that any server-side code you need to run should sit in a separate server application which you talk to over an API.

Jan Hesse's insight:

http://archjs.org

No comment yet.
Scoop.it!

Handling complex state with Baobab

Handling complex state with Baobab | JavaScript for Line of Business Applications | Scoop.it

Baobab gives you the same “one way flow” of state in FLUX, only it reduces a lot of the complexity. 

The point is that your components never mutate the tree and the actions never return state from the tree. Any change to state is done through an action which changes the tree, which notifies about the change to any components listening to that part of the tree. Baobab handles this very well and it integrates very well with React.

First of all we have to get a notion of what we are trying to solve. Even though Baobab up until version 1.0 gave us a great concept for handling state it was challenging to handle “shared data”. Let me explain.

No comment yet.
Scoop.it!

Mercury - A truly modular frontend framework

Mercury -  A truly modular frontend framework | JavaScript for Line of Business Applications | Scoop.it

Some of the core ideas are:

  • your entire view is a single complex vtree
  • your entire view state is a single complex immutable object.
  • your rendering function is pure, it takes just the view state (disclaimer: hooks & widgets are not pure).
  • you declare all user input as channels up front in your view state.
  • the view state supports cursors, you can nest components in components.

Mercury is unidirectional because:

  • A DOM event triggers a value to be send to a channel
  • The listener for the channel updates the view state
  • An update to the view state triggers a re-render
  • A new vtree is created
  • diff() and patch() update the DOM.


mercury is similar to react, however it's larger in scope, it is better compared against om or quiescent

  • mercury leverages virtual-dom which uses an immutable vdom structure
  • mercury comes with observ-struct which uses immutable data for your state atom
  • mercury is truly modular, you can trivially swap out subsets of it for other modules
  • mercury source code itself is maintainable, the modules it uses are all small, well tested and well documented. you should not be afraid to use mercury in production as it's easy to maintain & fix.
  • mercury encourages zero dom manipulation in your application code. As far as your application is concerned elements do not exist. This means you don't need to reference DOM elements when rendering or when handling events
  • mercury is compact, it's 11kb min.gzip.js, that's smaller than backbone.
  • mercury strongly encourages FRP techniques and discourages local mutable state.
  • mercury is highly performant, it's faster then React / Om / ember+htmlbars in multiple benchmarks TodoMVC benchmarkanimation benchmarkTodoMVC benchmark source
  • mercury comes with FP features like time-travel / easy undo out of the box.
  • mercury is lean, it's an weekend's read at 2.5kloc. (virtual-dom is 1.1kloc, an evening's read.) compared to react which is almost 20kloc (a month's read)
No comment yet.
Scoop.it!

Don’t Do, React! Understanding Meteor Reactive Programming

Don’t Do, React! Understanding Meteor Reactive Programming | JavaScript for Line of Business Applications | Scoop.it

In this blog post, I provide an in-depth explanation of reactive programming. I talk about the technical details of how reactivity is implemented in the Meteor framework. I also explain how you can take advantage of reactivity by using the Session object and reactive variables. Finally, I provide you with advice on getting the best performance when using reactivity.

No comment yet.
Scoop.it!

Bacon.js blog: Structuring Real-Life Applications

The Internet is full of smart peanut-size examples of how to solve X with "FRP" and Bacon.js. But how to organize a real-world size application? That's been asked once in a while and indeed I have an answer up in my sleeve. Don't take though that I'm saying this is the The Definitive Answer. I'm sure your own way is as good or better. Tell me about it!
I think there are some principles that you should apply to the design of any application though, like Single Reponsibility Principle and Separation of Concerns. Given that, your application should consist of components that are fairly independent of each others implementation details. I'd also like the components to communicate using some explicit signals instead of shared mutable state (nudge nudge Angular). For this purpose, I find the Bacon.js EventStreams andProperties quite handy.
No comment yet.
Scoop.it!

Reactive MVC and the Virtual DOM

Reactive MVC and the Virtual DOM | JavaScript for Line of Business Applications | Scoop.it

React turned out to disappoint me in multiple ways, mainly through a poorly designed API which induces the programmer to createcomplex state machines and to mix multiple concerns in one component. I decided to replace React with the great virtual-dom library, and to build a Reactive MVC alternative heavily based on RxJS. This pattern turned out to be successful and I applied it to other web apps. One of these is a customer project we are glad to say has worked out very well.

The combo React/Flux is clearly inspired by Reactive Programming principles, but the API and architecture are an unjustified mix of Interactive and Reactive patterns. Keep reading and I'll explain what this means, and how we can do better.

No comment yet.