@qooxdoo/framework 7.8.0 → 7.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/Manifest.json +2 -2
  2. package/lib/compiler/compile-info.json +72 -70
  3. package/lib/compiler/index.js +2255 -1385
  4. package/lib/resource/qx/tool/website/build/404.html +3 -25
  5. package/lib/resource/qx/tool/website/build/about.html +3 -25
  6. package/lib/resource/qx/tool/website/build/assets/common.js +20 -0
  7. package/lib/resource/qx/tool/website/build/diagnostics/dependson.html +3 -25
  8. package/lib/resource/qx/tool/website/build/diagnostics/requiredby.html +3 -22
  9. package/lib/resource/qx/tool/website/build/index.html +3 -25
  10. package/lib/resource/qx/tool/website/partials/footer.html +3 -21
  11. package/lib/resource/qx/tool/website/partials/head.html +0 -1
  12. package/package.json +2 -1
  13. package/source/class/qx/Bootstrap.js +6 -3
  14. package/source/class/qx/Promise.js +93 -6964
  15. package/source/class/qx/core/Environment.js +1 -0
  16. package/source/class/qx/data/marshal/Json.js +64 -11
  17. package/source/class/qx/event/handler/TouchCore.js +3 -1
  18. package/source/class/qx/lang/Type.js +36 -3
  19. package/source/class/qx/promise/BluebirdImpl.js +6918 -0
  20. package/source/class/qx/promise/NativeWrapper.js +738 -0
  21. package/source/class/qx/test/Promise.js +1145 -22
  22. package/source/class/qx/test/data/controller/List.js +6 -0
  23. package/source/class/qx/test/data/marshal/Json.js +29 -0
  24. package/source/class/qx/test/io/request/Xhr.js +16 -0
  25. package/source/class/qx/test/lang/Type.js +151 -0
  26. package/source/class/qx/theme/indigo/ColorDark.js +1 -1
  27. package/source/class/qx/ui/core/MPlacement.js +18 -7
  28. package/source/class/qx/ui/table/pane/Scroller.js +1 -1
  29. package/source/class/qx/util/ConcurrencyLimiter.js +78 -0
  30. package/source/resource/qx/tool/website/build/404.html +3 -25
  31. package/source/resource/qx/tool/website/build/about.html +3 -25
  32. package/source/resource/qx/tool/website/build/assets/common.js +20 -0
  33. package/source/resource/qx/tool/website/build/diagnostics/dependson.html +3 -25
  34. package/source/resource/qx/tool/website/build/diagnostics/requiredby.html +3 -22
  35. package/source/resource/qx/tool/website/build/index.html +3 -25
  36. package/source/resource/qx/tool/website/partials/footer.html +3 -21
  37. package/source/resource/qx/tool/website/partials/head.html +0 -1
  38. package/lib/resource/qx/tool/website/build/assets/bluebird.min.js +0 -4615
  39. package/lib/resource/qx/tool/website/src/assets/bluebird.min.js +0 -4615
  40. package/source/resource/qx/tool/website/build/assets/bluebird.min.js +0 -4615
  41. package/source/resource/qx/tool/website/src/assets/bluebird.min.js +0 -4615
@@ -891,6 +891,7 @@ qx.Bootstrap.define("qx.core.Environment", {
891
891
  "qx.dynlocale": true,
892
892
  "qx.dyntheme": true,
893
893
  "qx.blankpage": "qx/static/blank.html",
894
+ "qx.data.marshal.Json.breakOnNonPojos": false,
894
895
  "qx.debug.databinding": false,
895
896
  "qx.debug.dispose": false,
896
897
  "qx.debug.startupTimings": false,
@@ -37,6 +37,10 @@ qx.Class.define("qx.data.marshal.Json", {
37
37
  },
38
38
 
39
39
  statics: {
40
+ /**
41
+ * Set to true when a warning has been shown that we are using the deprecated behaviour of trying to marshall non-POJO objects into Qooxdoo objects.
42
+ */
43
+ __shownNotBreakingOnNonPojosWarning: false,
40
44
  $$instance: null,
41
45
 
42
46
  /**
@@ -76,6 +80,25 @@ qx.Class.define("qx.data.marshal.Json", {
76
80
  Object.keys(data).sort().join('"') +
77
81
  (includeBubbleEvents === true ? "♥" : "")
78
82
  );
83
+ },
84
+
85
+ /**
86
+ * If the environment setting "qx.data.marshal.Json.breakOnNonPojos" is not set,
87
+ * it means we are using the old behaviour of marshalling non-POJO objects.
88
+ * A warning is shown if it hasn't been shown already.
89
+ */
90
+ checkIfWarnAboutNotBreakingOnNonPojos() {
91
+ if (
92
+ !qx.core.Environment.get("qx.data.marshal.Json.breakOnNonPojos") &&
93
+ !this.__shownNotBreakingOnNonPojosWarning
94
+ ) {
95
+ console.warn(
96
+ `Using deprecated behaviour of not breaking on non-POJOs when marshalling.
97
+ Please set the environment setting "qx.data.marshal.Json.breakOnNonPojos" to enable the new behaviour.
98
+ The old behaviour will be removed in the next major release of Qooxdoo.`
99
+ );
100
+ this.__shownNotBreakingOnNonPojosWarning = true;
101
+ }
79
102
  }
80
103
  },
81
104
 
@@ -170,12 +193,26 @@ qx.Class.define("qx.data.marshal.Json", {
170
193
  * @param depth {Number} The depth of the data relative to the data's root.
171
194
  */
172
195
  __toClass(data, includeBubbleEvents, parentProperty, depth) {
196
+ const breakOnNonPojos = qx.core.Environment.get(
197
+ "qx.data.marshal.Json.breakOnNonPojos"
198
+ );
199
+ this.constructor.checkIfWarnAboutNotBreakingOnNonPojos();
200
+
173
201
  // break on all primitive json types and qooxdoo objects
174
- if (
175
- !qx.lang.Type.isObject(data) ||
176
- !!data.$$isString || // check for localized strings
177
- data instanceof qx.core.Object
178
- ) {
202
+ let shouldBreak;
203
+ if (breakOnNonPojos) {
204
+ shouldBreak =
205
+ !qx.lang.Type.isPojo(data) ||
206
+ !!data.$$isString || // check for localized strings
207
+ data instanceof qx.core.Object;
208
+ } else {
209
+ shouldBreak =
210
+ !qx.lang.Type.isObject(data) ||
211
+ !!data.$$isString || // check for localized strings
212
+ data instanceof qx.core.Object;
213
+ }
214
+
215
+ if (shouldBreak) {
179
216
  // check for arrays
180
217
  if (data instanceof Array || qx.Bootstrap.getClass(data) == "Array") {
181
218
  for (var i = 0; i < data.length; i++) {
@@ -405,15 +442,31 @@ qx.Class.define("qx.data.marshal.Json", {
405
442
  * @return {qx.core.Object} The created model object.
406
443
  */
407
444
  __toModel(data, includeBubbleEvents, parentProperty, depth) {
445
+ const breakOnNonPojos = qx.core.Environment.get(
446
+ "qx.data.marshal.Json.breakOnNonPojos"
447
+ );
448
+ this.constructor.checkIfWarnAboutNotBreakingOnNonPojos();
449
+
408
450
  var isObject = qx.lang.Type.isObject(data);
451
+ var isPojo = qx.lang.Type.isPojo(data);
452
+
409
453
  var isArray =
410
454
  data instanceof Array || qx.Bootstrap.getClass(data) == "Array";
411
455
 
412
- if (
413
- (!isObject && !isArray) ||
414
- !!data.$$isString || // check for localized strings
415
- data instanceof qx.core.Object
416
- ) {
456
+ let shouldBreak;
457
+ if (breakOnNonPojos) {
458
+ shouldBreak =
459
+ (!isPojo && !isArray) ||
460
+ !!data.$$isString || // check for localized strings
461
+ data instanceof qx.core.Object;
462
+ } else {
463
+ shouldBreak =
464
+ (!isObject && !isArray) ||
465
+ !!data.$$isString || // check for localized strings
466
+ data instanceof qx.core.Object;
467
+ }
468
+
469
+ if (shouldBreak) {
417
470
  return data;
418
471
 
419
472
  // ignore rules
@@ -451,7 +504,7 @@ qx.Class.define("qx.data.marshal.Json", {
451
504
  );
452
505
  }
453
506
  return array;
454
- } else if (isObject) {
507
+ } else if (breakOnNonPojos ? isPojo : isObject) {
455
508
  // create an instance for the object
456
509
  var hash = this.__jsonToBestHash(data, includeBubbleEvents);
457
510
  var model = this.__createInstance(hash, data, parentProperty, depth);
@@ -115,7 +115,9 @@ qx.Bootstrap.define("qx.event.handler.TouchCore", {
115
115
  "touchcancel"
116
116
  ];
117
117
 
118
- if (qx.core.Environment.get("event.mspointer")) {
118
+ // Ensure the workaround applies to IE only as intended
119
+ // See: https://github.com/qooxdoo/qooxdoo/issues/10774
120
+ if (qx.core.Environment.get("engine.name") == "mshtml" && qx.core.Environment.get("event.mspointer")) {
119
121
  var engineVersion = parseInt(
120
122
  qx.core.Environment.get("engine.version"),
121
123
  10
@@ -52,15 +52,48 @@ qx.Bootstrap.define("qx.lang.Type", {
52
52
  isArray: qx.Bootstrap.isArray,
53
53
 
54
54
  /**
55
- * Whether the value is an object. Note that built-in types like Window are
56
- * not reported to be objects.
57
55
  *
56
+ * Whether the value is an POJO (ie {})
57
+ * or an object which is created from a ES6-style class or prototypical-inheritance-based class;
58
+ * if you need to determine whether something is a POJO and not created from a class, use isPojo instead
59
+ *
60
+ * Note that built-in types like Window are not deemed to be objects.
58
61
  * @signature function(value)
59
- * @param value {var} Value to check.
62
+ * @param {*} value value to check.
60
63
  * @return {Boolean} Whether the value is an object.
61
64
  */
62
65
  isObject: qx.Bootstrap.isObject,
63
66
 
67
+ /**
68
+ * Whether the value is strictly a POJO.
69
+ * Its prototype chain must not contain any constructors which are not the Object constructor i.e. traditional prototype-based classes or ES6 classes.
70
+ *
71
+ * @param {*} value
72
+ * @returns {Boolean} Whether the value is strictly a POJO.
73
+ */
74
+ isPojo(value) {
75
+ if (qx.Bootstrap.getClass(value) != "Object") {
76
+ return false;
77
+ }
78
+
79
+ let prototype = Object.getPrototypeOf(value);
80
+ while (true) {
81
+ if (prototype === Object.prototype) {
82
+ return true;
83
+ }
84
+
85
+ if (
86
+ prototype.constructor &&
87
+ prototype.constructor !== Object.prototype.constructor
88
+ ) {
89
+ return false;
90
+ }
91
+
92
+ //loop tail
93
+ prototype = Object.getPrototypeOf(prototype);
94
+ }
95
+ },
96
+
64
97
  /**
65
98
  * Whether the value is a function.
66
99
  *