Add asynchronous hint to entities [#5127] #13023
Draft
+34
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a draft PR attempting to solve #5127. The issue has comments mentions several use cases, I'd personally like to add the use case of "hover" behavior which currently requires either using callback properties (not efficient on the scale in our app) or the primitive API directly (difficult to support compatibility with the entire Entity API).
The basic concept of this PR:
asynchronousproperty toEntityandGeometryUpdater(analogous to the getter-onlyasynchronousproperty onPrimitive), which defaults totrue<TYPE>Batchclasses. Each batch will pass its asynchronous flag to its internalPrimitive<TYPe>Batch.prototype.addmethod, when checking whether to create a newBatch, compare theasynchronousflags between the existingBatch's and theupdater, similarly as is done for materials, zIndex, etc...Questions:
Dynamic<TYPE>Updaterclasses always create aPrimitivewithasynchronous: false. I can't see the value in setting this totrue, so most likely the flag on theEntityshould just have a comment mentioning this. Should settingasynchronous: trueon a graphics with a dynamic property throw a runtime/developer error?StaticGroundPolylinePerMaterialBatchat least already supports anasynchronousflag it just isn't used. Other than that I think I can get it working there as wellasynchronouscreation state. Again I'm assuming that the flag having no effect here is a legitimate behavior. This leads me to the main question in terms of API design: should this be a flag on theEntity, or only on the relevant<TYPE>Graphicswhich even support asynchronous creation?Issue number and link
#5127
Testing plan
Initial example
TBD
Author checklist
CONTRIBUTORS.mdCHANGES.mdwith a short summary of my change