Skip to content

Commit 66d7ede

Browse files
authored
Merge pull request #6 from tbolis/libs-update
Libs update
2 parents 32a229c + b8d699c commit 66d7ede

File tree

8 files changed

+68
-54
lines changed

8 files changed

+68
-54
lines changed

.travis.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
before_install:
2-
- sudo apt-get -qq update
3-
- sudo apt-get install -y libcairo2-dev libjpeg-dev libgif-dev npm nodejs libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
4-
- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
5-
61
language: node_js
72
node_js:
8-
- '0.12'
3+
- "6"
4+
- "5"
5+
- "4"
6+
env:
7+
- CXX=g++-4.8
8+
addons:
9+
apt:
10+
sources:
11+
- ubuntu-toolchain-r-test
12+
packages:
13+
- g++-4.8
14+
before_install:
15+
- sudo apt-get update -qq
16+
- sudo apt-get install -qq libgif-dev libpng-dev libjpeg8-dev libpango1.0-dev libcairo2-dev
17+
script: 'npm run build && npm run test'

karma.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module.exports = function (config) {
3434
modulesDirectories: [
3535
'node_modules'
3636
],
37-
devtool: 'inline-source-map',
3837
resolve: {
3938
extensions: ['', '.js', '.jsx'],
4039
alias: {
@@ -52,6 +51,7 @@ module.exports = function (config) {
5251
]
5352
},
5453
debug: false,
54+
devtool: 'inline-source-map',
5555
stats: {
5656
colors: true,
5757
reasons: true

package.json

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-sketch",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "Sketch Element for React based applications, backed-up by fabricjs as its core",
55
"keywords": [
66
"react",
@@ -37,33 +37,34 @@
3737
"posttest": "npm run lint"
3838
},
3939
"engines": {
40-
"node": ">0.4.0 <1.0.0"
40+
"node": ">=4.4.1 <7.0.0"
4141
},
4242
"devDependencies": {
43-
"babel-cli": "^6.11.4",
44-
"babel-core": "^6.11.4",
43+
"babel-cli": "^6.14.0",
44+
"babel-core": "^6.14.0",
4545
"babel-eslint": "^6.1.2",
46-
"babel-loader": "^6.2.4",
46+
"babel-loader": "^6.2.5",
4747
"babel-plugin-transform-object-assign": "^6.8.0",
4848
"babel-plugin-transform-react-display-name": "^6.8.0",
4949
"babel-plugin-transform-runtime": "^6.12.0",
50-
"babel-polyfill": "^6.9.1",
51-
"babel-preset-es2015": "^6.9.0",
50+
"babel-polyfill": "^6.13.0",
51+
"babel-preset-es2015": "^6.14.0",
5252
"babel-preset-es2015-loose": "^7.0.0",
5353
"babel-preset-react": "^6.11.1",
5454
"babel-preset-react-hmre": "^1.1.1",
5555
"babel-preset-stage-0": "^6.5.0",
56-
"canvas": "1.3.16",
56+
"babel-runtime": "^6.11.6",
57+
"canvas": "1.4.0",
5758
"chai": "^3.5.0",
58-
"core-js": "^2.4.1",
59-
"css-loader": "^0.23.1",
60-
"eslint": "^3.2.2",
59+
"css-loader": "^0.24.0",
60+
"eslint": "^3.4.0",
6161
"eslint-loader": "^1.5.0",
62-
"eslint-plugin-react": "^6.0.0",
63-
"fabric": "1.6.2",
64-
"flexboxgrid": "^6.3.0",
62+
"eslint-plugin-react": "^6.2.0",
63+
"fabric": "1.6.3",
64+
"flexboxgrid": "^6.3.1",
6565
"html-webpack-plugin": "^2.22.0",
66-
"karma": "^1.1.2",
66+
"jsdom": "^9.4.2",
67+
"karma": "^1.2.0",
6768
"karma-babel-preprocessor": "^6.0.1",
6869
"karma-chai": "^0.1.0",
6970
"karma-coverage": "^1.1.1",
@@ -72,27 +73,27 @@
7273
"karma-phantomjs-launcher": "^1.0.1",
7374
"karma-phantomjs-shim": "^1.4.0",
7475
"karma-sourcemap-loader": "^0.3.7",
75-
"karma-webpack": "^1.7.0",
76-
"material-ui": "^0.15.3",
77-
"mocha": "^3.0.1",
76+
"karma-webpack": "^1.8.0",
77+
"material-ui": "^0.15.4",
78+
"mocha": "^3.0.2",
7879
"my-local-ip": "^1.0.0",
7980
"open": "0.0.5",
8081
"open-browser-webpack-plugin": "0.0.2",
81-
"phantomjs": "^2.1.7",
82-
"phantomjs-prebuilt": "^2.1.10",
83-
"react-addons-test-utils": "15.2.1",
84-
"react-color": "^2.2.2",
82+
"phantomjs-prebuilt": "^2.1.12",
83+
"react-addons-test-utils": "15.3.1",
84+
"react-color": "^2.2.6",
8585
"react-hot-loader": "^1.3.0",
8686
"react-tap-event-plugin": "latest",
8787
"rimraf": "^2.5.4",
8888
"style-loader": "^0.13.1",
89-
"webpack": "^1.13.1",
90-
"webpack-dev-server": "^1.14.1",
91-
"weinre": "^2.0.0-pre-I0Z7U9OV"
89+
"webpack": "^1.13.2",
90+
"webpack-dev-server": "^1.15.0",
91+
"weinre": "^2.0.0-pre-I0Z7U9OV",
92+
"xmldom": "^0.1.22"
9293
},
9394
"dependencies": {
94-
"react": "15.2.1",
95-
"react-addons-pure-render-mixin": "15.2.1",
96-
"react-dom": "15.2.1"
95+
"react": "15.3.1",
96+
"react-addons-pure-render-mixin": "15.3.1",
97+
"react-dom": "15.3.1"
9798
}
9899
}

src/SketchField.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ class SketchField extends Component {
9191
defaultData,
9292
defaultDataType} = this.props;
9393

94-
let canvas = this._fc = new fabric.Canvas(this._canvas.id);
94+
let canvas = this._fc = new fabric.Canvas(this._canvas.id/*, {
95+
preserveObjectStacking: false,
96+
renderOnAddRemove: false,
97+
skipTargetFind: true
98+
}*/);
99+
95100
this._initTools(canvas);
96101

97102
let selectedTool = this._tools[tool];

src/pencil.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ class Pencil extends FabricCanvasTool {
66

77
configureCanvas(props) {
88
this._canvas.isDrawingMode = true;
9-
// Initial line configuration
10-
let {freeDrawingBrush} = this._canvas;
11-
freeDrawingBrush.width = props.lineWidth;
12-
freeDrawingBrush.color = props.lineColor;
9+
this._canvas.freeDrawingBrush.width = props.lineWidth;
10+
this._canvas.freeDrawingBrush.color = props.lineColor;
1311
}
1412
}
1513

webpack.examples.cfg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var config = {
2929
},
3030
debug: false,
3131
cache: true,
32-
devtool: 'sourcemap',
32+
devtool: 'source-map',
3333
module: {
3434
loaders: [
3535
{test: /\.html$/, loader: 'html-loader', include: [examplesPath], exclude: /base\.html$/},

webpack.library.cfg.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const NoErrorsPlugin = require('webpack/lib/NoErrorsPlugin');
88
const DedupePlugin = require('webpack/lib/optimize/DedupePlugin');
99
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
1010
const OccurenceOrderPlugin = require('webpack/lib/optimize/OccurenceOrderPlugin');
11-
const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin');
1211
const AggressiveMergingPlugin = require('webpack/lib/optimize/AggressiveMergingPlugin');
1312

1413
const srcPath = path.join(__dirname, 'src');
@@ -67,7 +66,6 @@ module.exports = {
6766
new NoErrorsPlugin(),
6867
new OccurenceOrderPlugin(),
6968
new AggressiveMergingPlugin(),
70-
new HotModuleReplacementPlugin(),
7169
new IgnorePlugin(new RegExp('^(fs|ipc)$')),
7270
new DefinePlugin({'process.env.NODE_ENV': '"production"'})
7371
]

webpack.server.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,22 @@ require('core-js/fn/object/assign');
55

66
const path = require('path');
77
const webpack = require('webpack');
8-
const WebpackDevServer = require('webpack-dev-server');
98
const myLocalIP = require('my-local-ip');
9+
const WebpackDevServer = require('webpack-dev-server');
10+
11+
const DefinePlugin = require('webpack/lib/DefinePlugin');
1012
const HtmlWebpackPlugin = require('html-webpack-plugin');
1113
const NoErrorsPlugin = require('webpack/lib/NoErrorsPlugin');
14+
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
1215
const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin');
1316

1417
const srcPath = path.join(__dirname, 'src');
1518
const examplesPath = path.join(__dirname, 'examples');
1619

17-
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
18-
1920
const port = 23000;
2021
const host = myLocalIP();
21-
var config = {
22+
23+
const config = {
2224
port: port,
2325
entry: {
2426
examples: [
@@ -37,7 +39,7 @@ var config = {
3739
},
3840
debug: true,
3941
cache: true,
40-
devtool: 'eval',
42+
devtool: 'inline-source-map',
4143
devServer: {
4244
historyApiFallback: true,
4345
stats: {colors: true},
@@ -51,7 +53,7 @@ var config = {
5153
{
5254
test: /\.(js|jsx)$/,
5355
include: [srcPath],
54-
exclude: /(node_modules|bower_components)/,
56+
exclude: /(node_modules|bower_components|lib)/,
5557
loader: 'eslint-loader'
5658
}
5759
],
@@ -60,8 +62,8 @@ var config = {
6062
{
6163
test: /\.(js|jsx)$/,
6264
include: [srcPath, examplesPath],
63-
exclude: /(node_modules|bower_components)/,
64-
loaders: ['react-hot', 'babel']
65+
exclude: /(node_modules|bower_components|lib)/,
66+
loaders: ['babel']
6567
}
6668
]
6769
},
@@ -77,15 +79,16 @@ var config = {
7779
filename: 'index.html',
7880
chunks: ['examples']
7981
}),
80-
new OpenBrowserPlugin({url: 'http://localhost:' + port})
82+
new DefinePlugin({'process.env.NODE_ENV': '"development"'}),
83+
new OpenBrowserPlugin({url: 'http://' + host + ':' + port})
8184
]
8285
};
8386

8487
new WebpackDevServer(webpack(config), config.devServer)
85-
.listen(config.port, '0.0.0.0', function (err) {
88+
.listen(config.port, host, function (err) {
8689
if (err) {
8790
console.log(err);
8891
}
89-
console.log('Serving from http://localhost:' + config.port);
92+
console.log('Serving from http://' + host + ':' + port);
9093
}
9194
);

0 commit comments

Comments
 (0)