Merge pull request #664 from arv/splore-safari

Make `Splore work in Safari and Firefox
This commit is contained in:
Erik Arvidsson
2015-11-23 16:18:51 -05:00
27 changed files with 178 additions and 285 deletions

View File

@@ -1,11 +0,0 @@
{
"optional": ["asyncToGenerator"],
"blacklist": [
"es6.blockScoping",
"es6.constants",
"es6.forOf",
"es6.properties.computed",
"es6.properties.shorthand",
"es6.templateLiterals"
]
}

1
clients/chart/.babelrc Symbolic link
View File

@@ -0,0 +1 @@
../../js/.babelrc

View File

@@ -1,35 +0,0 @@
{
"parser": "babel-eslint",
"rules": {
"array-bracket-spacing": [2, "never"],
"camelcase": 2,
"eqeqeq": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"linebreak-style": [2, "unix"],
"no-multi-spaces": 2,
"no-new-wrappers": 2,
"no-throw-literal": 2,
"no-var": 2,
"object-curly-spacing": [2, "never"],
"quotes": [2, "single"],
"radix": 2,
"semi": 2,
"space-after-keywords": 2,
"space-before-function-paren": [2, "never"],
"space-infix-ops": 2,
"space-in-parens": [2, "never"]
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
},
"plugins": [
"react"
]
}

1
clients/chart/.eslintrc Symbolic link
View File

@@ -0,0 +1 @@
../../js/.eslintrc

View File

@@ -1,13 +0,0 @@
[ignore]
.*/node_modules/d3/.*
.*/node_modules/fbjs/flow/.*
.*/node_modules/react/.*
[include]
[libs]
[options]
unsafe.enable_getters_and_setters=true
munge_underscores=true
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue

1
clients/chart/.flowconfig Symbolic link
View File

@@ -0,0 +1 @@
../../js/.flowconfig

11
clients/chart/build.sh Executable file
View File

@@ -0,0 +1,11 @@
SRC="node_modules/babel-regenerator-runtime/runtime.js src/main.js"
OUT="out.js"
export NODE_ENV=production
cp node_modules/nvd3/build/nv.d3.min.css nv.d3.css
node_modules/.bin/browserify \
-p bundle-collapser/plugin \
$SRC \
| node_modules/.bin/uglifyjs -c -m > $OUT

View File

@@ -7,20 +7,33 @@
"react-dom": "^0.14.1"
},
"devDependencies": {
"babel": "^5.6.23",
"babel-eslint": "^4.1.3",
"babelify": "^6.1.3",
"babel-cli": "^6.1.18",
"babel-core": "^6.1.20",
"babel-eslint": "^4.1.5",
"babel-plugin-syntax-async-functions": "^6.1.18",
"babel-plugin-syntax-flow": "^6.1.18",
"babel-plugin-transform-class-properties": "^6.2.2",
"babel-plugin-transform-regenerator": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"babel-regenerator-runtime": "^6.2.0",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"bundle-collapser": "^1.2.1",
"chai": "^3.2.0",
"envify": "^3.4.0",
"eslint": "^1.7.3",
"eslint-plugin-react": "^3.6.3",
"eslint": "^1.9.0",
"eslint-plugin-react": "^3.8.0",
"flow-bin": "^0.18.1",
"grunt": "^0.4.5",
"mocha": "^2.3.0",
"uglify-js": "^2.6.1",
"watchify": "^3.6"
},
"scripts": {
"start": "cp node_modules/nvd3/build/nv.d3.css nv.d3.css; NOMS_SERVER=http://localhost:8000 watchify -o out.js -v -d src/main.js",
"build": "cp node_modules/nvd3/build/nv.d3.min.css nv.d3.css; NOMS_SERVER=http://localhost:8000 NODE_ENV=production browserify src/main.js > out.js",
"test": "rm -f out.js && eslint *.js && flow"
"start": "cp node_modules/nvd3/build/nv.d3.css nv.d3.css; watchify -o out.js -v -d src/main.js",
"build": "./build.sh",
"test": "rm -f out.js && eslint src/ && flow src/"
},
"browserify": {
"transform": [

View File

@@ -1,11 +0,0 @@
{
"optional": ["asyncToGenerator"],
"blacklist": [
"es6.blockScoping",
"es6.constants",
"es6.forOf",
"es6.properties.computed",
"es6.properties.shorthand",
"es6.templateLiterals"
]
}

View File

@@ -0,0 +1 @@
../../../js/.babelrc

View File

@@ -1,35 +0,0 @@
{
"parser": "babel-eslint",
"rules": {
"array-bracket-spacing": [2, "never"],
"camelcase": 2,
"eqeqeq": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"linebreak-style": [2, "unix"],
"no-multi-spaces": 2,
"no-new-wrappers": 2,
"no-throw-literal": 2,
"no-var": 2,
"object-curly-spacing": [2, "never"],
"quotes": [2, "single"],
"radix": 2,
"semi": 2,
"space-after-keywords": 2,
"space-before-function-paren": [2, "never"],
"space-infix-ops": 2,
"space-in-parens": [2, "never"]
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
},
"plugins": [
"react"
]
}

View File

@@ -0,0 +1 @@
../../../js/.eslintrc

View File

@@ -1,11 +0,0 @@
[ignore]
.*/node_modules/react/.*
.*/node_modules/fbjs/flow/.*
[include]
[libs]
[options]
unsafe.enable_getters_and_setters=true
munge_underscores=true

View File

@@ -0,0 +1 @@
../../../js/.flowconfig

9
clients/pitchmap/ui/build.sh Executable file
View File

@@ -0,0 +1,9 @@
SRC="node_modules/babel-regenerator-runtime/runtime.js main.js"
OUT="out.js"
export NODE_ENV=production
node_modules/.bin/browserify \
-p bundle-collapser/plugin \
$SRC \
| node_modules/.bin/uglifyjs -c -m > $OUT

View File

@@ -1,15 +1,13 @@
/* @flow */
import HeatMap from './heat_map.js';
import React from 'react'; //eslint-disable-line no-unused-lets
import React from 'react';
import ReactDOM from 'react-dom';
import {readValue, HttpStore, Ref} from 'noms';
let httpStore: HttpStore;
let renderNode: ?HTMLElement;
window.addEventListener('load', async () => {
renderNode = document.getElementById('heatmap');
httpStore = new HttpStore('http://localhost:8000');
let rootRef = await httpStore.getRoot();
let datasets = await readValue(rootRef, httpStore);
@@ -46,7 +44,7 @@ class PitcherList extends React.Component<DefaultProps, Props, State> {
};
}
render() {
render() : React.Element {
let currentPitcher = this.state.currentPitcher;
let pitchListRef = this.props.pitchersMap.get(currentPitcher);
@@ -69,5 +67,6 @@ class PitcherList extends React.Component<DefaultProps, Props, State> {
}
function renderPitchersMap(map: Map) {
let renderNode = document.getElementById('heatmap');
ReactDOM.render(<PitcherList pitchersMap={map}/>, renderNode);
}

View File

@@ -5,18 +5,37 @@
"react-dom": "^0.14.1"
},
"devDependencies": {
"babel": "^5.6.23",
"babel-eslint": "^4.1.3",
"babelify": "^6.1.3",
"babel-cli": "^6.1.18",
"babel-core": "^6.1.20",
"babel-eslint": "^4.1.5",
"babel-plugin-syntax-async-functions": "^6.1.18",
"babel-plugin-syntax-flow": "^6.1.18",
"babel-plugin-transform-class-properties": "^6.2.2",
"babel-plugin-transform-regenerator": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"babel-regenerator-runtime": "^6.2.0",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"eslint": "^1.7.3",
"eslint-plugin-react": "^3.6.3",
"bundle-collapser": "^1.2.1",
"chai": "^3.2.0",
"envify": "^3.4.0",
"eslint": "^1.9.0",
"eslint-plugin-react": "^3.8.0",
"flow-bin": "^0.18.1",
"mocha": "^2.3.0",
"uglify-js": "^2.6.1",
"watchify": "^3.6"
},
"scripts": {
"start": "watchify -o out.js -t babelify -v -d main.js",
"build": "NODE_ENV=production browserify main.js -t babelify > out.js",
"start": "watchify -o out.js -t babelify -v -d node_modules/babel-regenerator-runtime/runtime.js main.js",
"build": "./build.sh",
"test": "rm -f out.js && eslint *.js && flow"
},
"browserify": {
"transform": [
"babelify",
"envify"
]
}
}

View File

@@ -1,11 +0,0 @@
{
"optional": ["asyncToGenerator"],
"blacklist": [
"es6.blockScoping",
"es6.constants",
"es6.forOf",
"es6.properties.computed",
"es6.properties.shorthand",
"es6.templateLiterals"
]
}

1
clients/splore/.babelrc Symbolic link
View File

@@ -0,0 +1 @@
../../js/.babelrc

View File

@@ -1,35 +0,0 @@
{
"parser": "babel-eslint",
"rules": {
"array-bracket-spacing": [2, "never"],
"camelcase": 2,
"eqeqeq": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"linebreak-style": [2, "unix"],
"no-multi-spaces": 2,
"no-new-wrappers": 2,
"no-throw-literal": 2,
"no-var": 2,
"object-curly-spacing": [2, "never"],
"quotes": [2, "single"],
"radix": 2,
"semi": 2,
"space-after-keywords": 2,
"space-before-function-paren": [2, "never"],
"space-infix-ops": 2,
"space-in-parens": [2, "never"]
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
},
"plugins": [
"react"
]
}

1
clients/splore/.eslintrc Symbolic link
View File

@@ -0,0 +1 @@
../../js/.eslintrc

View File

@@ -1,11 +0,0 @@
[ignore]
.*/node_modules/react/.*
.*/node_modules/fbjs/flow/.*
[include]
[libs]
[options]
unsafe.enable_getters_and_setters=true
munge_underscores=true

1
clients/splore/.flowconfig Symbolic link
View File

@@ -0,0 +1 @@
../../js/.flowconfig

8
clients/splore/build.sh Executable file
View File

@@ -0,0 +1,8 @@
SRC="node_modules/babel-regenerator-runtime/runtime.js main.js"
OUT="out.js"
export NODE_ENV=production
node_modules/.bin/browserify \
-p bundle-collapser/plugin \
$SRC \
| node_modules/.bin/uglifyjs -c -m > $OUT

View File

@@ -3,6 +3,6 @@
<title>'Splore</title>
<meta charset="UTF-8">
<script src="out.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" href="styles.css">
</head>
<body><div id="splore"></div></body>

View File

@@ -6,23 +6,39 @@
"react-dom": "^0.14.1"
},
"devDependencies": {
"babel": "^5.6.23",
"babel-eslint": "^4.1.3",
"babelify": "^6.1.3",
"babel-cli": "^6.1.18",
"babel-core": "^6.1.20",
"babel-eslint": "^4.1.5",
"babel-plugin-syntax-async-functions": "^6.1.18",
"babel-plugin-syntax-flow": "^6.1.18",
"babel-plugin-transform-class-properties": "^6.2.2",
"babel-plugin-transform-regenerator": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"babel-regenerator-runtime": "^6.2.0",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"bundle-collapser": "^1.2.1",
"chai": "^3.2.0",
"envify": "^3.4.0",
"eslint": "^1.7.3",
"eslint-plugin-react": "^3.6.3",
"eslint": "^1.9.0",
"eslint-plugin-react": "^3.8.0",
"flow-bin": "^0.18.1",
"grunt": "^0.4.5",
"mocha": "^2.3.0",
"uglify-js": "^2.6.1",
"watchify": "^3.6"
},
"scripts": {
"start": "NOMS_SERVER=http://localhost:8000 watchify -o out.js -v -d main.js",
"build": "NOMS_SERVER=http://localhost:8000 NODE_ENV=production browserify main.js > out.js",
"prod_build": "NOMS_SERVER=http://ds.noms.io NODE_ENV=production browserify main.js > out.js",
"start": "NOMS_SERVER=http://localhost:8000 watchify -o out.js -v -d node_modules/babel-regenerator-runtime/runtime.js main.js",
"build": "NOMS_SERVER=http://localhost:8000 ./build.sh",
"prod_build": "NOMS_SERVER=http://ds.noms.io ./build.sh",
"test": "rm -f out.js && eslint *.js && flow"
},
"browserify": {
"transform": ["babelify", "envify"]
"transform": [
"babelify",
"envify"
]
}
}

View File

@@ -1,11 +0,0 @@
{
"optional": ["asyncToGenerator"],
"blacklist": [
"es6.blockScoping",
"es6.constants",
"es6.forOf",
"es6.properties.computed",
"es6.properties.shorthand",
"es6.templateLiterals"
]
}

1
clients/tagshow/.babelrc Symbolic link
View File

@@ -0,0 +1 @@
../../js/.babelrc

View File

@@ -1,35 +0,0 @@
{
"parser": "babel-eslint",
"rules": {
"array-bracket-spacing": [2, "never"],
"camelcase": 2,
"eqeqeq": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"linebreak-style": [2, "unix"],
"no-multi-spaces": 2,
"no-new-wrappers": 2,
"no-throw-literal": 2,
"no-var": 2,
"object-curly-spacing": [2, "never"],
"quotes": [2, "single"],
"radix": 2,
"semi": 2,
"space-after-keywords": 2,
"space-before-function-paren": [2, "never"],
"space-infix-ops": 2,
"space-in-parens": [2, "never"]
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
},
"plugins": [
"react"
]
}

1
clients/tagshow/.eslintrc Symbolic link
View File

@@ -0,0 +1 @@
../../js/.eslintrc

View File

@@ -1,11 +0,0 @@
[ignore]
.*/node_modules/react/.*
.*/node_modules/fbjs/flow/.*
[include]
[libs]
[options]
unsafe.enable_getters_and_setters=true
munge_underscores=true

1
clients/tagshow/.flowconfig Symbolic link
View File

@@ -0,0 +1 @@
../../js/.flowconfig

9
clients/tagshow/build.sh Executable file
View File

@@ -0,0 +1,9 @@
SRC="node_modules/babel-regenerator-runtime/runtime.js main.js"
OUT="tagshow.js"
export NODE_ENV=production
node_modules/.bin/browserify \
-p bundle-collapser/plugin \
$SRC \
| node_modules/.bin/uglifyjs -c -m > $OUT

View File

@@ -6,22 +6,38 @@
"react-dom": "^0.14.1"
},
"devDependencies": {
"babel-eslint": "^4.1.3",
"babel": "^5.6.23",
"babelify": "^6.1.3",
"babel-cli": "^6.1.18",
"babel-core": "^6.1.20",
"babel-eslint": "^4.1.5",
"babel-plugin-syntax-async-functions": "^6.1.18",
"babel-plugin-syntax-flow": "^6.1.18",
"babel-plugin-transform-class-properties": "^6.2.2",
"babel-plugin-transform-regenerator": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"babel-regenerator-runtime": "^6.2.0",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"bundle-collapser": "^1.2.1",
"chai": "^3.2.0",
"eslint-plugin-react": "^3.6.3",
"eslint": "^1.7.3",
"envify": "^3.4.0",
"eslint": "^1.9.0",
"eslint-plugin-react": "^3.8.0",
"flow-bin": "^0.18.1",
"mocha": "^2.3.0",
"uglify-js": "^2.6.1",
"watchify": "^3.6"
},
"scripts": {
"start": "watchify -o tagshow.js -t babelify -v -d main.js",
"build": "NODE_ENV=production browserify main.js -t babelify > tagshow.js",
"start": "watchify -o tagshow.js -t babelify -v -d node_modules/babel-regenerator-runtime/runtime.js main.js",
"build": "./build.sh",
"pretest": "rm -f tagshow.js && eslint *.js && flow",
"test": "mocha --ui tdd --reporter dot --compilers js:babel/register ./*_test.js"
"test": "mocha --ui tdd --reporter dot --compilers js:babel-core/register ./*_test.js"
},
"browserify": {
"transform": [
"babelify",
"envify"
]
}
}

View File

@@ -1,11 +1,9 @@
{
"optional": ["asyncToGenerator"],
"blacklist": [
"es6.blockScoping",
"es6.constants",
"es6.forOf",
"es6.properties.computed",
"es6.properties.shorthand",
"es6.templateLiterals"
"presets": ["react", "es2015"],
"plugins": [
"syntax-async-functions",
"syntax-flow",
"transform-class-properties",
"transform-regenerator"
]
}

View File

@@ -1,4 +1,8 @@
[ignore]
.*/node_modules/babel.*
.*/node_modules/babylon/.*
.*/node_modules/fbjs/.*
.*/node_modules/react/.*
[include]

View File

@@ -6,11 +6,19 @@
"text-encoding-utf-8": "^1.0.1"
},
"devDependencies": {
"babel": "~5.6.23",
"babel-eslint": "^4.1.3",
"babel-cli": "^6.1.18",
"babel-core": "^6.1.20",
"babel-eslint": "^4.1.5",
"babel-plugin-syntax-async-functions": "^6.1.18",
"babel-plugin-syntax-flow": "^6.1.18",
"babel-plugin-transform-class-properties": "^6.2.2",
"babel-plugin-transform-regenerator": "^6.2.0",
"babel-polyfill": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"chai": "^3.2.0",
"eslint": "^1.7.3",
"eslint-plugin-react": "^3.6.3",
"eslint": "^1.9.0",
"eslint-plugin-react": "^3.8.0",
"flow-bin": "^0.18.1",
"mocha": "^2.3.0"
},
@@ -18,7 +26,7 @@
"start": "babel -w src/ -d dist/",
"build": "babel src/ -d dist/",
"pretest": "eslint src/ && flow src/",
"test": "mocha --ui tdd --reporter dot --compilers js:babel/register src/"
"test": "mocha --ui tdd --reporter dot --require babel-polyfill --compilers js:babel-core/register src/"
},
"browser": {
"./dist/fetch.js": "./dist/browser/fetch.js"

View File

@@ -25,8 +25,8 @@ export default class HttpStore {
constructor(url: string, maxReads: number = 3) {
this._rpc = {
getRefs: url + '/getRefs/',
ref: url + '/ref',
root: url + '/root'
ref: url + '/ref/',
root: url + '/root/'
};
this._readQueue = Object.create(null);
this._anyPending = false;

View File

@@ -8,11 +8,10 @@ import {encodeNomsValue} from './encode.js';
import {readValue} from './decode.js';
import {Type} from './type.js';
import Struct from './struct.js';
import ChunkStore from './chunk_store.js';
import type {ChunkStore} from './chunk_store.js';
export {
Chunk,
ChunkStore,
encodeNomsValue,
HttpStore,
MemoryStore,
@@ -21,3 +20,5 @@ export {
Struct,
Type
};
export type {ChunkStore};