• Stars
    star
    2,220
  • Rank 20,780 (Top 0.5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reactive Flux built with ImmutableJS data structures. Framework agnostic.

NuclearJS

Build Status Coverage Status Join the chat at https://gitter.im/optimizely/nuclear-js

Sauce Test Status

Traditional Flux architecture built with ImmutableJS data structures.

Documentation

https://optimizely.github.io/nuclear-js/

Design Philosophy

  • Simple Over Easy - The purpose of NuclearJS isn't to write the most expressive TodoMVC anyone's ever seen. The goal of NuclearJS is to provide a way to model data that is easy to reason about and decouple at very large scale.

  • Immutable - A means for less defensive programming, more predictability and better performance.

  • Functional - The framework should be implemented functionally wherever appropriate. This reduces incidental complexity and pairs well with Immutability.

  • Smallest Amount of State Possible - Using NuclearJS should encourage the modeling of your application state in the most minimal way possible.

  • Decoupled - A NuclearJS system should be able to function without any sort of UI or frontend. It should be backend/frontend agnostic and be able to run on a NodeJS server.

Installation

NuclearJS can be downloaded from npm.

npm install nuclear-js

Examples

  • Shopping Cart Example - Provides a general overview of basic NuclearJS concepts: actions, stores and getters with ReactJS.
  • Flux Chat Example - A classic Facebook flux chat example written in NuclearJS.
  • Rest API Example - Shows how to deal with fetching data from an API using NuclearJS conventions.
  • Hot reloadable stores - Shows how to setup stores to be hot reloadable using webpack hot module replacement.

How NuclearJS differs from other Flux implementations

  1. All app state is in a singular immutable map, like Om. In development you can see your entire application state at every point in time thanks to awesome debugging tools built into NuclearJS.

  2. State is not spread out through stores, instead stores are a declarative way of describing some top-level domain of your app state. For each key in the app state map a store declares the initial state of that key and how that piece of the app state reacts over time to actions dispatched on the flux system.

  3. Stores are not reference-able nor have any getX methods on them. Instead NuclearJS uses a functional lens concept called getters. In fact, the use of getters obviates the need for any store to know about another store, eliminating the confusing store.waitsFor method found in other flux implementations.

  4. NuclearJS is insanely efficient - change detection granularity is infinitesimal, you can even observe computed state where several pieces of the state map are combined together and run through a transform function. NuclearJS is smart enough to know when the value of any computed changes and only call its observer if and only if its value changed in a way that is orders of magnitude more efficient than traditional dirty checking. It does this by leveraging ImmutableJS data structure and using a state1 !== state2 reference comparison which runs in constant time.

  5. Automatic data observation / rendering -- automatic re-rendering is built in for React in the form of a very lightweight mixin. It is also easily possible to build the same functionality for any UI framework such as VueJS, AngularJS and even Backbone.

  6. NuclearJS is not a side-project, it's used as the default Flux implementation that powers all of Optimizely. It is well tested and will continue to be maintained for the foreseeable future. Our current codebase has over dozens of stores, actions and getters, we even share our prescribed method of large scale code organization and testing strategies.

Performance

Getters are only calculated whenever their dependencies change. So if the dependency is a keypath then it will only recalculate when that path in the app state map has changed (which can be done as a simple state.getIn(keyPath) !== oldState.getIn(keyPath) which is an O(log32(n)) operation. The other case is when a getter is dependent on other getters. Since every getter is a pure function, NuclearJS will only recompute the getter if the values of its dependencies change.

API Documentation

API Documentation

For Smaller Applications

NuclearJS was designed first and foremost for large scale production codebases. For a much more lightweight Flux implementation that shares many of the same ideas and design principles check out Microcosm.

Contributing

Contributions are welcome, especially with the documentation website and examples. See CONTRIBUTING.md.

More Repositories

1

react-sdk

React SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
TypeScript
88
star
2

hyperloglog

HyperLogLog distinct value estimator for Node.js
JavaScript
85
star
3

javascript-sdk

JavaScript SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
JavaScript
76
star
4

library

Optimizely Library
JavaScript
75
star
5

chord

Chord distributed hash table for Node.js
JavaScript
63
star
6

android-sdk

Android SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Java
55
star
7

isomorphic-react-demo-app

Optimizely X Fullstack Isomorphic React Demo App
JavaScript
47
star
8

java-sdk

Java SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Java
40
star
9

python-sdk

Python SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Python
32
star
10

Optimizely-iOS-SDK

Optimizely Classic iOS SDK. For Optimizely X Mobile go here:
Objective-C
31
star
11

agent

Agent service for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Go
30
star
12

python-sdk-demo-app

Python Full Stack demo application
Python
24
star
13

objective-c-sdk

Optimizely X Objective-C SDK for iOS and tvOS
Objective-C
24
star
14

ruby-sdk

Ruby SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Ruby
24
star
15

ssrm

Sequential Sample Ratio Mismatch(SRM) Test
Python
22
star
16

swift-sdk

Swift SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Swift
21
star
17

optimizely-client-python

Optimizely's Python client library is an interface to its REST API.
Python
20
star
18

csharp-sdk

.NET based C# SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
C#
19
star
19

php-sdk

PHP SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
PHP
18
star
20

go-sdk

Go SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Go
18
star
21

optimizely-node

Optimizely API for node.js
JavaScript
16
star
22

remote-jenkins-job

Trigger a Remote Jenkins Job with parameters and get console output as well as result
Shell
16
star
23

fullstack-labs

TypeScript
13
star
24

optimizely-api-samples

Code samples for APIs documented on developers.optimizely.com
Java
12
star
25

wordpress-plugin

An Optimizely plugin for Wordpress.
PHP
11
star
26

Optimizely-Android-SDK

Optimizely Classic Android SDK. For Optimizely X Mobile go here:
HTML
11
star
27

oevents

A CLI for exporting Optimizely Events
Shell
10
star
28

oui-icons

Deprecated icons for Optimizely:Β use react-oui-icons
HTML
9
star
29

optimizely-cordova-plugin

Cordova plugin for Optimizely iOS and Android SDKs
JavaScript
9
star
30

jira-templates

To hold templates for descriptions of various types of JIRA tickets (Bugs, Features, etc.)
8
star
31

optimizely-vscode

The vscode extension for optimizely feature and experiment key access
TypeScript
8
star
32

kubeluigi

Run Luigi tasks as Jobs on K8s - An updated Kubernetes contrib
Python
8
star
33

fastly-compute-starter-kit

Fastly Edge Woker Starter Kit for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
JavaScript
8
star
34

serverless-sendToSlack

Python
7
star
35

javascript-sdk-demo-app

JavaScript (Frontend) Full Stack demo application
JavaScript
7
star
36

node-sdk

(Deprecated) Optimizely Full Stack SDK
JavaScript
7
star
37

optimizely-flutter-sdk

Flutter SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
Dart
6
star
38

labs

An experimental public repository for holding various Optimizely Labs
Jupyter Notebook
6
star
39

snippet-inspector

JavaScript
6
star
40

scribe

Long-form static, reponsive HTML publishing engine for Optimizely.
CSS
6
star
41

react-oui-icons

Inline React SVG OUI icons system.
JavaScript
5
star
42

wordpress-optimizely-x

PHP
5
star
43

messenger-fullstack-example

An example of using Full Stack with Facebook messenger
JavaScript
5
star
44

cloudflare-worker-template

JavaScript
4
star
45

twilio-serverless-sms-demo

An example of running an Optimizely Full Stack experiment with the Node SDK on a Twilio Programmable SMS service through their Serverless Function capability.
JavaScript
4
star
46

android-demo

Demo apps showing Optimizely's Android SDK
Java
4
star
47

optimizely-cli

Python
3
star
48

scribesass-parser

Automatically generate documentation for Sass files.
JavaScript
3
star
49

ses-research-public

CSS
3
star
50

javascript-sdk-plugin-pending-events

Event Dispatcher plugin that provides a persistent pending event queue
JavaScript
3
star
51

fullstack-outbound-marketing

Full Stack Outbound Marketing Demos
HTML
3
star
52

Docebo-SSO

Single-Sign On functionality for the Docebo LMS
Python
3
star
53

rake_report

Ruby gem for timeline visualization of rake tasks
Ruby
3
star
54

upload-custom-code-action

A Github Action that enables Optimizely customers to upload custom JS / CSS to their projects
JavaScript
3
star
55

canvas-getting-started-python

Canvas Getting Started Guide (Python)
HTML
2
star
56

optimizely_dev_tools

CSS
2
star
57

optimizely-canvas-js-sdk

An SDK providing JavaScript utilities for developing on the Optimizely Canvas.
JavaScript
2
star
58

clean-data

JavaScript
2
star
59

react-oui

OUI standalone react components with no sass.
JavaScript
2
star
60

intellij-plugin

IntelliJ plugin for all IntelliJ versions.
Java
2
star
61

snyk-test

Demonstrate an issue with snyk.io and devDependencies
Shell
2
star
62

zuora-client-python

A Zuora python OpenAPI client generated from Zuora Swagger specs
Python
2
star
63

alexa-demo

Demo of Optimizely Full Stack with an Alexa Skill using AWS Lambda
JavaScript
2
star
64

tvOS-demo

Demo tvOS App for the Optimizely tvOS SDK
Objective-C
2
star
65

pycon2019

intermediate representation for pycon notes, may be absorbed into outlines repo later
Python
2
star
66

express-middleware

FullStack & Rollouts Express Middleware
JavaScript
2
star
67

canvas-node-quickstart

A project to help you get started with canvas using node.js and app engine
JavaScript
2
star
68

fx-api-cookbook

This repo contains API recipes to get started with Optimizely Feature Experimentation (FX). πŸ‘©β€πŸ³
2
star
69

ga2optly_v2

Python
1
star
70

ios-landing-page

CSS
1
star
71

scylla-bench-crate

constant rate benchmark tool for scylla
Rust
1
star
72

stripe-ctf-cookbook

For bootstrapping stripe's ctf exercises
Ruby
1
star
73

analyze-css

Track a stylesheet's payload over time.
JavaScript
1
star
74

marketingautomationintegration-odp

Optimizely forms integration with ODP to save customer data to ODP
C#
1
star
75

vue-utils

TypeScript
1
star
76

fs_rest_customer

Example python scripts that use the REST API for FS objects
Python
1
star
77

php-sdk-demo-app

PHP Full Stack demo application
PHP
1
star
78

opticon-fs-odp-demo

1
star
79

go-sdk-c-wrapper

A C wrapper for the Go SDK enabling Full Stack and Rollouts in C.
Go
1
star
80

unlock-tf-state-github-action

1
star
81

github-action-ticket-reference-checker-public

TypeScript
1
star
82

optimizelyd-maildir

Fullstack disk based event dispatcher using maildir queue
Rust
1
star
83

little-clojurer-public

Shell
1
star
84

fetch-all-github-repos

Go
1
star
85

Optimizely_Hello_World_Swift_iOS

A sample app demonstrating the use of Optimizely's Swift SDK V 3.2.1 for feature management using free Optimizely Rollouts
Swift
1
star
86

snippet-config

An illustration of the use of Optimizely X Full Stack to configure the Optimizely X Web snippet on a simple web page.
HTML
1
star
87

aws-lambda-at-edge-starter-kit

AWS Lambda at Edge Starter Kit for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
JavaScript
1
star
88

rollouts-getting-started-js

JavaScript
1
star
89

next-js-starter-kit

TypeScript
1
star
90

akamai-edgeworker-starter-kit

Akamai Edgeworker Starter Kit for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
JavaScript
1
star