-
-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8 0 beta #10592
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting! I hope I will have the opportunity to test it in the near future. Until then- as it passed the tests, I trust it's ready as it is for a breaking release
… a compatible release. also, fixes an issue where the environment check `qx.future.checkjsdoc` is now declared as `qx.Class.futureCheckJsDoc` so that the compiler can detect it and eliminate code (this fixes the require warning for jsdoctypeparser) also, blocks declaring variables called `arguments` which breaks uglify
I'm finding this quite hard to debug - stepping into an ordinary method called While debugging, the inspector shows nothing at first: and when the There's another 4 pages of property values, and my actual properties are hidden in the middle. Is it the case that every method call will be wrapped with a function? What effect does the extra properties in the object have on memory usage? |
Yes, deep debugging requires a bit of getting used to, but once you get used to it, you learn to quickly run-until-function-exit on some of the calls. It's not that each is wrapped in a function; rather, the proxy wraps the entire object. Every access to the object runs through the proxy. That includes access to methods, so first, you'll see a |
BTW, the vast majority of those object properties already existed in the old property system, but you typically had no reason to notice them. I added a few as necessary features of the new property system. |
Every other debugging experience I can think of just steps into the function. It looks really odd, and I can't imagine new users taking to it very easily.
I don't remember seeing them; they were presumably in the prototype or in a closure before? My debugger now shows 210 properties when there were approx 30 before. IMHO that is confusing and makes it difficult to see whats going on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has quite an impact on debuggability - every single method call (not just properties) now goes via the proxy handler code; IMHO that's a bit confusing and distracting. Also, every property now causes 7 fields to be added to each object, which adds pages of irrelevant details to an object.
AIUI Object.defineProperty
can be used to achieve the desired effect (ie native property values) without using Proxy
, meaning that debugging is much simpler.
Here's a proof of concept that native properties can be added to the existing v7 qx.Class
classes:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what a pseudo property is. Something is either defined in the |
Add cross compiler to 8.x beta
we discussed it here: #10410
they do this because the property system did not allow custom storage
It's what qooxdoo does and how binding works. It sniffs, basically deciding that if there is a get, set, reset, and change event, it is a property. |
Ok, I've added support for pseudo-properties. I excluded the test for the I also added tests for it, as there apparently weren't any previously. |
// Next try to parse the check string as JSDoc | ||
let bJSDocParsed = false; | ||
try { | ||
const { parse } = require("jsdoctypeparser"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate that this is currently switched off, but IMHO we should not plan on including require in browser based builds because it forces the user to use npm and have a package; years ago, one of the 1&1 team added grunt and it was very frustrating to have to create a package.json etc just to be able to compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember that require
in a browser-based app includes the browserified code. There should be o need for the user to use npm and have a package; the compiler should be browserifying that code from qooxdoo's node_modules.
That said, I don't have any strong need for this feature. We could strip it out completely. We could, later, implement it with our own code to parse JSDoc comments. Or whatever. Let me know if you'd like for me to entirely remove that code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the jsdoc parser would be useful, but at the moment browserify does not work as you're propising (although I think it would be good if it did). I havn't specifically tested, but the compiler was complaining that it could not find the module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible that the node_modules path of qooxdoo needs to be added to the compiler's search for require
d modules for it to work as desired. That's a separate issue that I can look into it, but it's separate from this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the jsdoc parser would be useful, but at the moment browserify does not work as you're propising (although I think it would be good if it did). I havn't specifically tested, but the compiler was complaining that it could not find the module
I just pushed a fix to this. The compiler now looks in both the app's node_modules directory and qooxdoo's node_modules directory for browserifyable modules. This means that jsdoctypeparser
, used by Class.js
(when enabled by the environment variable, later), is found regardless of whether there is a node_modules directory in the user's app.
``` | ||
instance[2] = 42; | ||
value = instance[2]; | ||
delete instance[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please can you explain how delete
is implemented? EG does this mean that you could have two objects of the same class, but one has undefined
for the property because it has been deleted but the other does not, even if the definition of the property says that an uninitialised value is impossible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling delete instance[2]
is identical to calling instance.removeAt(2)
because the delete
is trapped and removeAt
is actually called in its stead.
}, | ||
|
||
delete(property) { | ||
// If the property is a number or string representing a number... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete dataArray[2]
is not the same as dataArray.removeAt(2)
because delete
will simply create a hole in the array where as removeAt
will shuffle the elements down. Does qx.data.Array support sparse arrays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete dataArray[2]
in qx.data.Array is implemented as dataArray.removeAt(2)
. I don't believe that qx.data.Array supports sparse arrays, so we probably don't want dataArray.removeAt(2)
to leave an undefined
hole. The implementation is trivially changeable, though. Do you have suggestions for a different implementation? (It's marked as experimental, so what we do now can be changed later.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's different semantics - calling delete myNativeArray[2]
is not the same as myDataArray.removeAt(2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. What would you have it do instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. It now throws an exception by default. If environment variable qx.data.Array.deleteAsRemoveAt
is true
then it acts as I had implemented it originally.
….deleteAsRemoveAt' is true
@derrell would it be possible to progress this PR? I appreciate you're busy, but it would be good to see it come to a conclusion |
There wasn't any action for nearly a year now. Is this still active? |
Yes - I have a version which seems to be complete but I need to merge the current master into it so that I can do the tests; I'm just stupidly busy at work at the moment, sorry for the delay - I'm really keen to get it out |
New class/property system