Skip to content

Commit 5cfa22c

Browse files
pivotalgeorgedpage
authored andcommitted
Fix React to work with QtWebKit
We learned that the underlying issue was related to react-dom's SyntheticEvent.augmentClass function being undefined. This seems to be caused by attempted property assignment after the SyntheticEvent had been replaced by a Proxy of itself. This works fine in Chromium et al, but QtWebKit doesn't deal with Proxy Event objects well. Moving the augmentClass definition and assignment up above the Proxy stuff resolves the issue in a PR to React: facebook/react#10011
1 parent a45b87d commit 5cfa22c

File tree

6 files changed

+75
-108
lines changed

6 files changed

+75
-108
lines changed

web/pgadmin/static/vendor/react-dom/dist/react-dom-server.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12136,6 +12136,29 @@ _assign(SyntheticEvent.prototype, {
1213612136

1213712137
SyntheticEvent.Interface = EventInterface;
1213812138

12139+
/**
12140+
* Helper to reduce boilerplate when creating subclasses.
12141+
*
12142+
* @param {function} Class
12143+
* @param {?object} Interface
12144+
*/
12145+
SyntheticEvent.augmentClass = function (Class, Interface) {
12146+
var Super = this;
12147+
12148+
var E = function () {};
12149+
E.prototype = Super.prototype;
12150+
var prototype = new E();
12151+
12152+
_assign(prototype, Class.prototype);
12153+
Class.prototype = prototype;
12154+
Class.prototype.constructor = Class;
12155+
12156+
Class.Interface = _assign({}, Super.Interface, Interface);
12157+
Class.augmentClass = Super.augmentClass;
12158+
12159+
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
12160+
};
12161+
1213912162
if ("development" !== 'production') {
1214012163
if (isProxySupported) {
1214112164
/*eslint-disable no-func-assign */
@@ -12159,28 +12182,6 @@ if ("development" !== 'production') {
1215912182
/*eslint-enable no-func-assign */
1216012183
}
1216112184
}
12162-
/**
12163-
* Helper to reduce boilerplate when creating subclasses.
12164-
*
12165-
* @param {function} Class
12166-
* @param {?object} Interface
12167-
*/
12168-
SyntheticEvent.augmentClass = function (Class, Interface) {
12169-
var Super = this;
12170-
12171-
var E = function () {};
12172-
E.prototype = Super.prototype;
12173-
var prototype = new E();
12174-
12175-
_assign(prototype, Class.prototype);
12176-
Class.prototype = prototype;
12177-
Class.prototype.constructor = Class;
12178-
12179-
Class.Interface = _assign({}, Super.Interface, Interface);
12180-
Class.augmentClass = Super.augmentClass;
12181-
12182-
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
12183-
};
1218412185

1218512186
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
1218612187

web/pgadmin/static/vendor/react-dom/dist/react-dom-server.min.js

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pgadmin/static/vendor/react-dom/dist/react-dom.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14072,6 +14072,29 @@ _assign(SyntheticEvent.prototype, {
1407214072

1407314073
SyntheticEvent.Interface = EventInterface;
1407414074

14075+
/**
14076+
* Helper to reduce boilerplate when creating subclasses.
14077+
*
14078+
* @param {function} Class
14079+
* @param {?object} Interface
14080+
*/
14081+
SyntheticEvent.augmentClass = function (Class, Interface) {
14082+
var Super = this;
14083+
14084+
var E = function () {};
14085+
E.prototype = Super.prototype;
14086+
var prototype = new E();
14087+
14088+
_assign(prototype, Class.prototype);
14089+
Class.prototype = prototype;
14090+
Class.prototype.constructor = Class;
14091+
14092+
Class.Interface = _assign({}, Super.Interface, Interface);
14093+
Class.augmentClass = Super.augmentClass;
14094+
14095+
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
14096+
};
14097+
1407514098
if ("development" !== 'production') {
1407614099
if (isProxySupported) {
1407714100
/*eslint-disable no-func-assign */
@@ -14095,28 +14118,6 @@ if ("development" !== 'production') {
1409514118
/*eslint-enable no-func-assign */
1409614119
}
1409714120
}
14098-
/**
14099-
* Helper to reduce boilerplate when creating subclasses.
14100-
*
14101-
* @param {function} Class
14102-
* @param {?object} Interface
14103-
*/
14104-
SyntheticEvent.augmentClass = function (Class, Interface) {
14105-
var Super = this;
14106-
14107-
var E = function () {};
14108-
E.prototype = Super.prototype;
14109-
var prototype = new E();
14110-
14111-
_assign(prototype, Class.prototype);
14112-
Class.prototype = prototype;
14113-
Class.prototype.constructor = Class;
14114-
14115-
Class.Interface = _assign({}, Super.Interface, Interface);
14116-
Class.augmentClass = Super.augmentClass;
14117-
14118-
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
14119-
};
1412014121

1412114122
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
1412214123

web/pgadmin/static/vendor/react-dom/dist/react-dom.min.js

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pgadmin/static/vendor/react-dom/lib/SyntheticEvent.js

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,29 @@ _assign(SyntheticEvent.prototype, {
182182

183183
SyntheticEvent.Interface = EventInterface;
184184

185+
/**
186+
* Helper to reduce boilerplate when creating subclasses.
187+
*
188+
* @param {function} Class
189+
* @param {?object} Interface
190+
*/
191+
SyntheticEvent.augmentClass = function (Class, Interface) {
192+
var Super = this;
193+
194+
var E = function () {};
195+
E.prototype = Super.prototype;
196+
var prototype = new E();
197+
198+
_assign(prototype, Class.prototype);
199+
Class.prototype = prototype;
200+
Class.prototype.constructor = Class;
201+
202+
Class.Interface = _assign({}, Super.Interface, Interface);
203+
Class.augmentClass = Super.augmentClass;
204+
205+
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
206+
};
207+
185208
if (process.env.NODE_ENV !== 'production') {
186209
if (isProxySupported) {
187210
/*eslint-disable no-func-assign */
@@ -205,28 +228,6 @@ if (process.env.NODE_ENV !== 'production') {
205228
/*eslint-enable no-func-assign */
206229
}
207230
}
208-
/**
209-
* Helper to reduce boilerplate when creating subclasses.
210-
*
211-
* @param {function} Class
212-
* @param {?object} Interface
213-
*/
214-
SyntheticEvent.augmentClass = function (Class, Interface) {
215-
var Super = this;
216-
217-
var E = function () {};
218-
E.prototype = Super.prototype;
219-
var prototype = new E();
220-
221-
_assign(prototype, Class.prototype);
222-
Class.prototype = prototype;
223-
Class.prototype.constructor = Class;
224-
225-
Class.Interface = _assign({}, Super.Interface, Interface);
226-
Class.augmentClass = Super.augmentClass;
227-
228-
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
229-
};
230231

231232
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
232233

@@ -264,4 +265,4 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
264265
var warningCondition = false;
265266
process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
266267
}
267-
}
268+
}

web/yarn.lock

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,15 +1199,7 @@ [email protected]:
11991199
readable-stream "~2.0.0"
12001200
typedarray "~0.0.5"
12011201

1202-
concat-stream@^1.5.2:
1203-
version "1.6.0"
1204-
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7"
1205-
dependencies:
1206-
inherits "^2.0.3"
1207-
readable-stream "^2.2.2"
1208-
typedarray "^0.0.6"
1209-
1210-
concat-stream@~1.5.0, concat-stream@~1.5.1:
1202+
concat-stream@^1.5.2, concat-stream@~1.5.0, concat-stream@~1.5.1:
12111203
version "1.5.2"
12121204
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266"
12131205
dependencies:
@@ -3649,7 +3641,7 @@ read-pkg@^1.0.0:
36493641
normalize-package-data "^2.3.2"
36503642
path-type "^1.0.0"
36513643

3652-
readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6:
3644+
readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.6:
36533645
version "2.3.0"
36543646
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.0.tgz#640f5dcda88c91a8dc60787145629170813a1ed2"
36553647
dependencies:
@@ -4310,7 +4302,7 @@ type-is@~1.6.15:
43104302
media-typer "0.3.0"
43114303
mime-types "~2.1.15"
43124304

4313-
typedarray@^0.0.6, typedarray@~0.0.5:
4305+
typedarray@~0.0.5:
43144306
version "0.0.6"
43154307
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
43164308

0 commit comments

Comments
 (0)