From 1e502a7a2bd8bb62c549371c8e9d3c2dfc0e4f59 Mon Sep 17 00:00:00 2001 From: Pavel Turchik Date: Mon, 11 Nov 2019 21:12:50 +0300 Subject: [PATCH 1/2] patch racer to fix problem related to cutting code by metro bundler in release mode --- packages/init/package.json | 2 +- packages/model/package.json | 2 +- packages/offline/package.json | 2 +- packages/orm/package.json | 2 +- packages/react-sharedb/package.json | 2 +- template/patches/racer+0.9.9.patch | 16 ++++++++++++++++ 6 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 template/patches/racer+0.9.9.patch diff --git a/packages/init/package.json b/packages/init/package.json index 0d3b9df..6e9d8c6 100644 --- a/packages/init/package.json +++ b/packages/init/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "bluebird": "^3.5.0", - "racer": "^0.9.3", + "racer": "0.9.9", "rich-text": "^4.0.0", "sharedb": "^1.0.0-beta.22" }, diff --git a/packages/model/package.json b/packages/model/package.json index ff303e4..fe9605a 100644 --- a/packages/model/package.json +++ b/packages/model/package.json @@ -22,7 +22,7 @@ }, "license": "MIT", "dependencies": { - "racer": "^0.9.3", + "racer": "0.9.9", "racer-highway": "^8.1.0" }, "devDependencies": { diff --git a/packages/offline/package.json b/packages/offline/package.json index 4981734..21bc28b 100644 --- a/packages/offline/package.json +++ b/packages/offline/package.json @@ -36,7 +36,7 @@ "husky": "^0.14.3", "lint-staged": "^4.3.0", "prettier-standard": "^7.0.3", - "racer": "*", + "racer": "0.9.9", "sharedb": "*", "standard": "^10.0.3" }, diff --git a/packages/orm/package.json b/packages/orm/package.json index dbb1060..d5f8df9 100644 --- a/packages/orm/package.json +++ b/packages/orm/package.json @@ -10,7 +10,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "racer": "^0.9.3" + "racer": "0.9.9" }, "author": "cray0000 ", "license": "MIT", diff --git a/packages/react-sharedb/package.json b/packages/react-sharedb/package.json index bbe7ca2..4d7a81b 100644 --- a/packages/react-sharedb/package.json +++ b/packages/react-sharedb/package.json @@ -28,7 +28,7 @@ "@startupjs/model": "^0.8.1", "hoist-non-react-statics": "^1.2.0", "lodash": "4.x", - "racer": "^0.9.3", + "racer": "0.9.9", "rich-text": "^4.0.0", "sharedb": "^1.0.0-beta.22" }, diff --git a/template/patches/racer+0.9.9.patch b/template/patches/racer+0.9.9.patch new file mode 100644 index 0000000..8f8444f --- /dev/null +++ b/template/patches/racer+0.9.9.patch @@ -0,0 +1,16 @@ +diff --git a/node_modules/racer/lib/Model/events.js b/node_modules/racer/lib/Model/events.js +index e5aaf3f..c8c8e1b 100644 +--- a/node_modules/racer/lib/Model/events.js ++++ b/node_modules/racer/lib/Model/events.js +@@ -260,9 +260,10 @@ function eventListener(model, eventType, arg2, arg3, arg4) { + // on(eventType, cb) + cb = arg2; + } ++ var useEventObjects; + if (options) { + if (options.useEventObjects) { +- var useEventObjects = true; ++ useEventObjects = true; + } + } + From 992979645b38550e0d00f0813b295621324c1893 Mon Sep 17 00:00:00 2001 From: Pavel Turchik Date: Mon, 11 Nov 2019 21:29:15 +0300 Subject: [PATCH 2/2] improve racer patch --- template/patches/racer+0.9.9.patch | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/template/patches/racer+0.9.9.patch b/template/patches/racer+0.9.9.patch index 8f8444f..5340e87 100644 --- a/template/patches/racer+0.9.9.patch +++ b/template/patches/racer+0.9.9.patch @@ -1,16 +1,21 @@ diff --git a/node_modules/racer/lib/Model/events.js b/node_modules/racer/lib/Model/events.js -index e5aaf3f..c8c8e1b 100644 +index e5aaf3f..c68c10a 100644 --- a/node_modules/racer/lib/Model/events.js +++ b/node_modules/racer/lib/Model/events.js -@@ -260,9 +260,10 @@ function eventListener(model, eventType, arg2, arg3, arg4) { - // on(eventType, cb) - cb = arg2; +@@ -241,7 +241,7 @@ Model.prototype.removeContextListeners = function(value) { + * @param {string} eventType + */ + function eventListener(model, eventType, arg2, arg3, arg4) { +- var subpattern, options, cb; ++ var subpattern, options, cb, useEventObjects; + if (arg4) { + // on(eventType, path, options, cb) + subpattern = arg2; +@@ -262,7 +262,7 @@ function eventListener(model, eventType, arg2, arg3, arg4) { } -+ var useEventObjects; if (options) { if (options.useEventObjects) { - var useEventObjects = true; + useEventObjects = true; } } -