Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: optimizely/nuclear-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.4.0
Choose a base ref
...
head repository: optimizely/nuclear-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Sep 21, 2016

  1. Copy the full SHA
    12a2c70 View commit details
  2. Copy the full SHA
    c9589fa View commit details

Commits on Sep 27, 2016

  1. Merge pull request #222 from raulmatei/patch-1

    Correct year in change log file
    jordangarcia authored Sep 27, 2016
    Copy the full SHA
    368f721 View commit details

Commits on Sep 28, 2016

  1. Add logger hooks for notify

    Also properly bind context to the logger
    jordangarcia committed Sep 28, 2016
    Copy the full SHA
    53f6357 View commit details
  2. Merge pull request #224 from optimizely/jordan/add-notify-logging

    Add logger hooks for notify
    jordangarcia authored Sep 28, 2016
    Copy the full SHA
    d91f6d3 View commit details

Commits on Nov 28, 2016

  1. Copy the full SHA
    3a7d6ec View commit details

Commits on Jan 3, 2017

  1. Update LICENSE.md

    bhamodi authored Jan 3, 2017
    Copy the full SHA
    f527025 View commit details

Commits on Jun 14, 2017

  1. Merge pull request #227 from bhamodi/patch-1

    Update LICENSE.md
    Michael Fields authored Jun 14, 2017
    Copy the full SHA
    1e53154 View commit details

Commits on Apr 15, 2018

  1. Typo in README.md

    Fixes a typo in README.md
    kamronbatman authored Apr 15, 2018
    Copy the full SHA
    3473419 View commit details

Commits on Sep 20, 2018

  1. Copy the full SHA
    fa56967 View commit details
  2. Merge pull request #235 from optimizely/update_lodash

    [Chore] Bump Lodash from 3.X to 4.17.11
    alansun-optimizely authored Sep 20, 2018
    Copy the full SHA
    09273c9 View commit details
  3. Merge pull request #234 from kamronbatman/patch-1

    Typo in README.md
    alansun-optimizely authored Sep 20, 2018
    Copy the full SHA
    102fe39 View commit details

Commits on Jan 22, 2025

  1. Copy the full SHA
    136739c View commit details
  2. Copy the full SHA
    b00a257 View commit details
  3. Copy the full SHA
    e55b860 View commit details
  4. stashing changes

    alexjoeyyong committed Jan 22, 2025
    Copy the full SHA
    44f3733 View commit details
  5. test

    alexjoeyyong committed Jan 22, 2025
    Copy the full SHA
    1224fb9 View commit details
  6. lint fixes

    alexjoeyyong committed Jan 22, 2025
    Copy the full SHA
    01ca3c9 View commit details
  7. updates

    alexjoeyyong committed Jan 22, 2025
    Copy the full SHA
    592fea7 View commit details
  8. gitignore

    alexjoeyyong committed Jan 22, 2025
    Copy the full SHA
    6d07168 View commit details

Commits on Jan 23, 2025

  1. Merge pull request #245 from optimizely/EC3-1545-gha-migration

    EC3-1545 migrate from travis.yml to GHA
    alexjoeyyong authored Jan 23, 2025
    Copy the full SHA
    593b003 View commit details

Commits on Jan 24, 2025

  1. Copy the full SHA
    5103ed3 View commit details
  2. Merge pull request #246 from optimizely/EC3-1545-nuclear-js

    EC3-1545 remove readme.md
    alexjoeyyong authored Jan 24, 2025
    Copy the full SHA
    3542439 View commit details
Showing with 717 additions and 172 deletions.
  1. +37 −0 .github/workflows/run-tests.yml
  2. +1 −0 .gitignore
  3. +1 −1 CHANGELOG.md
  4. +20 −6 Gruntfile.js
  5. +1 −1 LICENSE.md
  6. +1 −4 README.md
  7. 0 .travis.yml → deprecatedtravis.yml
  8. +1 −1 examples/rest-api/package.json
  9. +3 −8 grunt/aliases.js
  10. +25 −24 grunt/karma.js
  11. +0 −85 grunt/sauce.js
  12. +6 −7 package.json
  13. +312 −0 perf/reactor.js
  14. +233 −0 resources/bench.js
  15. +19 −14 src/logging.js
  16. +12 −3 src/reactor.js
  17. +17 −6 src/reactor/fns.js
  18. +1 −2 src/reactor/records.js
  19. +27 −10 tests/reactor-tests.js
37 changes: 37 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# .github/workflows/nodejs-ci.yml
name: Run Tests for Nuclear JS

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4

# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.18.1

# Install grunt-cli globally
- name: Install grunt-cli
run: npm install -g grunt-cli

# Install dependencies
- name: Install dependencies
run: npm install

# Run tests
- name: Run tests
run: grunt ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
coverage/
package-lock.json
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.4.0 (September 21, 2015)
## 1.4.0 (September 21, 2016)


- **[NEW]** Added ability to switch out the default caching strategy for caching getter values. Also expose an LRU cache that can be swapped in for the basic cache
26 changes: 20 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
module.exports = function(grunt) {
require('load-grunt-config')(grunt)
// load npm tasks
grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-karma-coveralls')
}
module.exports = function (grunt) {
// Load grunt configurations
require('load-grunt-config')(grunt, {
configPath: require('path').join(__dirname, 'grunt'),
init: true,
});

// Load npm tasks
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');

// Default task for Chrome and Firefox
grunt.registerTask('test', ['karma:chrome', 'karma:firefox']);

// Separate task for Chrome only
grunt.registerTask('test:chrome', ['karma:chrome']);

// Separate task for Firefox only
grunt.registerTask('test:firefox', ['karma:firefox']);
};
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2016 Optimizely
Copyright (c) 2014-Present, Optimizely

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
NuclearJS

[![Build Status](https://travis-ci.org/optimizely/nuclear-js.svg?branch=master)](https://travis-ci.org/optimizely/nuclear-js)
[![Coverage Status](https://coveralls.io/repos/optimizely/nuclear-js/badge.svg?branch=master)](https://coveralls.io/r/optimizely/nuclear-js?branch=master)
[![Join the chat at https://gitter.im/optimizely/nuclear-js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/optimizely/nuclear-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/nuclearjs.svg)](https://saucelabs.com/u/nuclearjs)

Traditional Flux architecture built with ImmutableJS data structures.

## Documentation
@@ -55,7 +52,7 @@ npm install nuclear-js

## 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 if its dependencies change.
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

File renamed without changes.
2 changes: 1 addition & 1 deletion examples/rest-api/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"dependencies": {
"nuclear-js": "^1.0.x",
"react": "^0.13.0",
"lodash": "^3.5.0",
"lodash": "^4.17.11",
"keymirror": "^0.1.1",
"babel-loader": "^5.3.2"
},
11 changes: 3 additions & 8 deletions grunt/aliases.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
module.exports = {
'test': [
'karma:phantom',
'karma:chrome',
'karma:firefox',
],

'sauce': [
'karma:sauce_modern',
'karma:sauce_ie',
'karma:sauce_mobile',
],

'ci': [
'eslint',
'clean:coverage',
'karma:coverage',
'coveralls',
//'sauce', TODO: investigate why sauce connect isnt working
// 'coveralls', //doesn't seem to be a thing anymore.
],
}
49 changes: 25 additions & 24 deletions grunt/karma.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
var sauce = require('./sauce')
var path = require('path')

module.exports = {
options: {
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: path.join(__dirname, '../'),
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],

// list of files / patterns to load in the browser
@@ -43,22 +41,37 @@ module.exports = {
},
},

phantom: {
frameworks: ['jasmine', 'es5-shim'],
browsers: ['PhantomJS'],
chrome: {
frameworks: ['jasmine'],
reporters: ['progress', 'html'],
browsers: ['ChromeHeadless'], // Use ChromeHeadless for CI
customLaunchers: {
HeadlessChrome: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--disable-gpu'], // Required for CI environments
},
},
autoWatch: false,
singleRun: true,
},

chrome: {
reporters: ['html'],
browsers: ['Chrome'],
autoWatch: true,
singleRun: false,
firefox: {
frameworks: ['jasmine'],
reporters: ['progress', 'html'],
browsers: ['FirefoxHeadless'], // Use FirefoxHeadless for CI
customLaunchers: {
HeadlessFirefox: {
base: 'FirefoxHeadless',
},
},
autoWatch: false,
singleRun: true,
},

coverage: {
frameworks: ['jasmine', 'es5-shim'],
frameworks: ['jasmine'],
reporters: ['progress', 'coverage'],
browsers: ['PhantomJS'],
browsers: ['ChromeHeadless', 'FirefoxHeadless'], // Run tests on both browsers for coverage
coverageReporter: {
reporters: [
{ type: 'html', dir: 'coverage/' },
@@ -82,16 +95,4 @@ module.exports = {
},
},
},

sauce_modern: {
options: sauce.modern,
},

sauce_ie: {
options: sauce.ie,
},

sauce_mobile: {
options: sauce.mobile,
},
}
85 changes: 0 additions & 85 deletions grunt/sauce.js

This file was deleted.

13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuclear-js",
"version": "1.3.0",
"version": "1.4.0",
"description": "Immutable, reactive Flux architecture. UI Agnostic.",
"main": "dist/nuclear.js",
"scripts": {
@@ -30,9 +30,9 @@
"immutable": "^3.8.1"
},
"devDependencies": {
"grunt": "^0.4.5",
"babel-core": "^5.8.29",
"babel-loader": "^5.3.2",
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-eslint": "^14.0.0",
"grunt-githooks": "^0.3.1",
@@ -45,18 +45,17 @@
"jstransform": "^11.0.1",
"jstransform-loader": "^0.2.0",
"karma": "^0.13.3",
"karma-chrome-launcher": "^0.2.0",
"karma-chrome-launcher": "^0.2.3",
"karma-coverage": "^0.4.2",
"karma-es5-shim": "https://github.com/pokehanai/karma-es5-shim/archive/v2.1.0.tar.gz",
"karma-firefox-launcher": "^2.1.3",
"karma-jasmine": "^0.3.6",
"karma-jasmine-html-reporter": "^0.1.8",
"karma-phantomjs-launcher": "^0.2.0",
"karma-sauce-launcher": "^0.2.14",
"karma-webpack": "^1.7.0",
"load-grunt-config": "^0.17.1",
"lodash": "^3.9.3",
"lodash": "^4.17.11",
"node-libs-browser": "^0.5.2",
"phantomjs": "^1.9.17",
"puppeteer": "^24.1.0",
"react": "^0.13.3",
"webpack": "^1.10.5"
}
Loading