@contember/binding 1.2.6 → 1.3.0-alpha.2
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.
- package/dist/development/BindingError.cjs +10 -0
- package/dist/development/BindingError.cjs.map +1 -0
- package/dist/development/accessorTree/NormalizedPersistedData.cjs +10 -0
- package/dist/development/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/development/accessorTree/RuntimeId.cjs +64 -0
- package/dist/development/accessorTree/RuntimeId.cjs.map +1 -0
- package/dist/development/accessors/EntityAccessor.cjs +169 -0
- package/dist/development/accessors/EntityAccessor.cjs.map +1 -0
- package/dist/development/accessors/EntityAccessor.js +1 -1
- package/dist/development/accessors/EntityListAccessor.cjs +101 -0
- package/dist/development/accessors/EntityListAccessor.cjs.map +1 -0
- package/dist/development/accessors/ErrorAccessor.cjs +16 -0
- package/dist/development/accessors/ErrorAccessor.cjs.map +1 -0
- package/dist/development/accessors/FieldAccessor.cjs +59 -0
- package/dist/development/accessors/FieldAccessor.cjs.map +1 -0
- package/dist/development/accessors/TreeRootAccessor.cjs +14 -0
- package/dist/development/accessors/TreeRootAccessor.cjs.map +1 -0
- package/dist/development/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/development/bindingTypes.cjs +9 -0
- package/dist/development/bindingTypes.cjs.map +1 -0
- package/dist/development/core/AccessorErrorManager.cjs +207 -0
- package/dist/development/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/development/core/AccessorErrorManager.js +5 -4
- package/dist/development/core/AccessorErrorManager.js.map +1 -1
- package/dist/development/core/Config.cjs +32 -0
- package/dist/development/core/Config.cjs.map +1 -0
- package/dist/development/core/DataBinding.cjs +352 -0
- package/dist/development/core/DataBinding.cjs.map +1 -0
- package/dist/development/core/DataBinding.js +53 -46
- package/dist/development/core/DataBinding.js.map +1 -1
- package/dist/development/core/DirtinessTracker.cjs +29 -0
- package/dist/development/core/DirtinessTracker.cjs.map +1 -0
- package/dist/development/core/ErrorsPreprocessor.cjs +181 -0
- package/dist/development/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/development/core/ErrorsPreprocessor.js +16 -16
- package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/development/core/EventManager.cjs +440 -0
- package/dist/development/core/EventManager.cjs.map +1 -0
- package/dist/development/core/EventManager.js +7 -5
- package/dist/development/core/EventManager.js.map +1 -1
- package/dist/development/core/MarkerComparator.cjs +79 -0
- package/dist/development/core/MarkerComparator.cjs.map +1 -0
- package/dist/development/core/MarkerMerger.cjs +252 -0
- package/dist/development/core/MarkerMerger.cjs.map +1 -0
- package/dist/development/core/MarkerMerger.js +2 -2
- package/dist/development/core/MutationGenerator.cjs +635 -0
- package/dist/development/core/MutationGenerator.cjs.map +1 -0
- package/dist/development/core/MutationGenerator.js +341 -294
- package/dist/development/core/MutationGenerator.js.map +1 -1
- package/dist/development/core/QueryGenerator.cjs +113 -0
- package/dist/development/core/QueryGenerator.cjs.map +1 -0
- package/dist/development/core/QueryGenerator.js +62 -75
- package/dist/development/core/QueryGenerator.js.map +1 -1
- package/dist/development/core/RealmKeyGenerator.cjs +47 -0
- package/dist/development/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/development/core/RequestResponseNormalizer.cjs +125 -0
- package/dist/development/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/development/core/StateInitializer.cjs +389 -0
- package/dist/development/core/StateInitializer.cjs.map +1 -0
- package/dist/development/core/StateInitializer.js +2 -2
- package/dist/development/core/StateInitializer.js.map +1 -1
- package/dist/development/core/TreeAugmenter.cjs +213 -0
- package/dist/development/core/TreeAugmenter.cjs.map +1 -0
- package/dist/development/core/TreeFilterGenerator.cjs +83 -0
- package/dist/development/core/TreeFilterGenerator.cjs.map +1 -0
- package/dist/development/core/TreeParameterMerger.cjs +304 -0
- package/dist/development/core/TreeParameterMerger.cjs.map +1 -0
- package/dist/development/core/TreeParameterMerger.js +8 -0
- package/dist/development/core/TreeParameterMerger.js.map +1 -1
- package/dist/development/core/TreeStore.cjs +182 -0
- package/dist/development/core/TreeStore.cjs.map +1 -0
- package/dist/development/core/TreeStore.js +1 -1
- package/dist/development/core/VariableInputTransformer.cjs +24 -0
- package/dist/development/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/development/core/exceptions/ErrorLocator.cjs +62 -0
- package/dist/development/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/development/core/exceptions/LocalizedBindingError.cjs +14 -0
- package/dist/development/core/exceptions/LocalizedBindingError.cjs.map +1 -0
- package/dist/development/core/exceptions/MarkerSugarer.cjs +56 -0
- package/dist/development/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/development/core/exceptions/TreeParameterSugarer.cjs +33 -0
- package/dist/development/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/development/core/factories/createBatchUpdatesOptions.cjs +20 -0
- package/dist/development/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/development/core/operations/EntityOperations.cjs +238 -0
- package/dist/development/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/development/core/operations/EntityOperations.js +1 -1
- package/dist/development/core/operations/FieldOperations.cjs +96 -0
- package/dist/development/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/development/core/operations/FieldOperations.js +1 -1
- package/dist/development/core/operations/ListOperations.cjs +159 -0
- package/dist/development/core/operations/ListOperations.cjs.map +1 -0
- package/dist/development/core/operations/OperationsHelpers.cjs +85 -0
- package/dist/development/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/development/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/development/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/development/core/schema/Schema.cjs +39 -0
- package/dist/development/core/schema/Schema.cjs.map +1 -0
- package/dist/development/core/schema/SchemaLoader.cjs +28 -0
- package/dist/development/core/schema/SchemaLoader.cjs.map +1 -0
- package/dist/development/core/schema/SchemaLoader.js +2 -2
- package/dist/development/core/schema/SchemaLoader.js.map +1 -1
- package/dist/development/core/schema/SchemaPreprocessor.cjs +38 -0
- package/dist/development/core/schema/SchemaPreprocessor.cjs.map +1 -0
- package/dist/development/core/state/StateIterator.cjs +100 -0
- package/dist/development/core/state/StateIterator.cjs.map +1 -0
- package/dist/development/core/state/getEntityMarker.cjs +5 -0
- package/dist/development/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/development/core/utils/createQueryBuilder.cjs +32 -0
- package/dist/development/core/utils/createQueryBuilder.cjs.map +1 -0
- package/dist/development/core/utils/createQueryBuilder.js +32 -0
- package/dist/development/core/utils/createQueryBuilder.js.map +1 -0
- package/dist/development/core/utils/getCombinedSignal.cjs +33 -0
- package/dist/development/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/development/dao/Environment.cjs +213 -0
- package/dist/development/dao/Environment.cjs.map +1 -0
- package/dist/development/dao/Environment.js.map +1 -1
- package/dist/development/dao/TreeNodeEnvironmentFactory.cjs +89 -0
- package/dist/development/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
- package/dist/development/dao/VariableFieldValue.cjs +9 -0
- package/dist/development/dao/VariableFieldValue.cjs.map +1 -0
- package/dist/development/fieldHelpers/helpers/FieldHelper.cjs +17 -0
- package/dist/development/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/development/index.cjs +124 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +18 -135
- package/dist/development/index.js.map +1 -1
- package/dist/development/markers/EntityFieldMarkersContainer.cjs +41 -0
- package/dist/development/markers/EntityFieldMarkersContainer.cjs.map +1 -0
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.cjs +11 -0
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
- package/dist/development/markers/EntityListSubTreeMarker.cjs +23 -0
- package/dist/development/markers/EntityListSubTreeMarker.cjs.map +1 -0
- package/dist/development/markers/EntitySubTreeMarker.cjs +23 -0
- package/dist/development/markers/EntitySubTreeMarker.cjs.map +1 -0
- package/dist/development/markers/FieldMarker.cjs +20 -0
- package/dist/development/markers/FieldMarker.cjs.map +1 -0
- package/dist/development/markers/HasManyRelationMarker.cjs +29 -0
- package/dist/development/markers/HasManyRelationMarker.cjs.map +1 -0
- package/dist/development/markers/HasOneRelationMarker.cjs +23 -0
- package/dist/development/markers/HasOneRelationMarker.cjs.map +1 -0
- package/dist/development/markers/MarkerTreeRoot.cjs +10 -0
- package/dist/development/markers/MarkerTreeRoot.cjs.map +1 -0
- package/dist/development/markers/ParentEntityMarker.cjs +10 -0
- package/dist/development/markers/ParentEntityMarker.cjs.map +1 -0
- package/dist/development/markers/PlaceholderGenerator.cjs +23 -0
- package/dist/development/markers/PlaceholderGenerator.cjs.map +1 -0
- package/dist/development/markers/PlaceholderParametersGenerator.cjs +62 -0
- package/dist/development/markers/PlaceholderParametersGenerator.cjs.map +1 -0
- package/dist/development/queryLanguage/CacheStore.cjs +47 -0
- package/dist/development/queryLanguage/CacheStore.cjs.map +1 -0
- package/dist/development/queryLanguage/CacheStore.js +2 -1
- package/dist/development/queryLanguage/CacheStore.js.map +1 -1
- package/dist/development/queryLanguage/MarkerFactory.cjs +200 -0
- package/dist/development/queryLanguage/MarkerFactory.cjs.map +1 -0
- package/dist/development/queryLanguage/MarkerFactory.js +1 -1
- package/dist/development/queryLanguage/Parser.cjs +728 -0
- package/dist/development/queryLanguage/Parser.cjs.map +1 -0
- package/dist/development/queryLanguage/Parser.js +64 -23
- package/dist/development/queryLanguage/Parser.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguage.cjs +520 -0
- package/dist/development/queryLanguage/QueryLanguage.cjs.map +1 -0
- package/dist/development/queryLanguage/QueryLanguage.js +3 -1
- package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguageError.cjs +6 -0
- package/dist/development/queryLanguage/QueryLanguageError.cjs.map +1 -0
- package/dist/development/queryLanguage/tokenList.cjs +150 -0
- package/dist/development/queryLanguage/tokenList.cjs.map +1 -0
- package/dist/development/queryLanguage/tokenList.js +1 -1
- package/dist/development/queryLanguage/tokenList.js.map +1 -1
- package/dist/development/structures/BijectiveIndexedMap.cjs +120 -0
- package/dist/development/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/development/structures/LRUCache.cjs +35 -0
- package/dist/development/structures/LRUCache.cjs.map +1 -0
- package/dist/development/structures/WeakIdCache.cjs +33 -0
- package/dist/development/structures/WeakIdCache.cjs.map +1 -0
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.cjs +22 -0
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
- package/dist/development/treeParameters/EntityCreationParameters.cjs +8 -0
- package/dist/development/treeParameters/EntityCreationParameters.cjs.map +1 -0
- package/dist/development/treeParameters/EntityListPreferences.cjs +7 -0
- package/dist/development/treeParameters/EntityListPreferences.cjs.map +1 -0
- package/dist/development/treeParameters/EventListenersStore.cjs +70 -0
- package/dist/development/treeParameters/EventListenersStore.cjs.map +1 -0
- package/dist/development/treeParameters/LeafField.cjs +7 -0
- package/dist/development/treeParameters/LeafField.cjs.map +1 -0
- package/dist/development/treeParameters/QualifiedEntityParameters.cjs +7 -0
- package/dist/development/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
- package/dist/development/treeParameters/Relation.cjs +7 -0
- package/dist/development/treeParameters/Relation.cjs.map +1 -0
- package/dist/development/utils/Hashing.cjs +22 -0
- package/dist/development/utils/Hashing.cjs.map +1 -0
- package/dist/development/utils/TreeNodeUtils.cjs +77 -0
- package/dist/development/utils/TreeNodeUtils.cjs.map +1 -0
- package/dist/development/utils/assert.cjs +11 -0
- package/dist/development/utils/assert.cjs.map +1 -0
- package/dist/development/utils/assertNever.cjs +10 -0
- package/dist/development/utils/assertNever.cjs.map +1 -0
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/development/utils/isEmptyObject.cjs +12 -0
- package/dist/development/utils/isEmptyObject.cjs.map +1 -0
- package/dist/development/utils/ucfirst.cjs +5 -0
- package/dist/development/utils/ucfirst.cjs.map +1 -0
- package/dist/production/BindingError.cjs +10 -0
- package/dist/production/BindingError.cjs.map +1 -0
- package/dist/production/accessorTree/NormalizedPersistedData.cjs +10 -0
- package/dist/production/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/production/accessorTree/RuntimeId.cjs +64 -0
- package/dist/production/accessorTree/RuntimeId.cjs.map +1 -0
- package/dist/production/accessors/EntityAccessor.cjs +169 -0
- package/dist/production/accessors/EntityAccessor.cjs.map +1 -0
- package/dist/production/accessors/EntityAccessor.js +1 -1
- package/dist/production/accessors/EntityListAccessor.cjs +101 -0
- package/dist/production/accessors/EntityListAccessor.cjs.map +1 -0
- package/dist/production/accessors/ErrorAccessor.cjs +16 -0
- package/dist/production/accessors/ErrorAccessor.cjs.map +1 -0
- package/dist/production/accessors/FieldAccessor.cjs +59 -0
- package/dist/production/accessors/FieldAccessor.cjs.map +1 -0
- package/dist/production/accessors/TreeRootAccessor.cjs +14 -0
- package/dist/production/accessors/TreeRootAccessor.cjs.map +1 -0
- package/dist/production/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/production/bindingTypes.cjs +9 -0
- package/dist/production/bindingTypes.cjs.map +1 -0
- package/dist/production/core/AccessorErrorManager.cjs +207 -0
- package/dist/production/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/production/core/AccessorErrorManager.js +5 -4
- package/dist/production/core/AccessorErrorManager.js.map +1 -1
- package/dist/production/core/Config.cjs +32 -0
- package/dist/production/core/Config.cjs.map +1 -0
- package/dist/production/core/DataBinding.cjs +352 -0
- package/dist/production/core/DataBinding.cjs.map +1 -0
- package/dist/production/core/DataBinding.js +53 -46
- package/dist/production/core/DataBinding.js.map +1 -1
- package/dist/production/core/DirtinessTracker.cjs +29 -0
- package/dist/production/core/DirtinessTracker.cjs.map +1 -0
- package/dist/production/core/ErrorsPreprocessor.cjs +181 -0
- package/dist/production/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/production/core/ErrorsPreprocessor.js +16 -16
- package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/production/core/EventManager.cjs +414 -0
- package/dist/production/core/EventManager.cjs.map +1 -0
- package/dist/production/core/EventManager.js +7 -5
- package/dist/production/core/EventManager.js.map +1 -1
- package/dist/production/core/MarkerComparator.cjs +79 -0
- package/dist/production/core/MarkerComparator.cjs.map +1 -0
- package/dist/production/core/MarkerMerger.cjs +252 -0
- package/dist/production/core/MarkerMerger.cjs.map +1 -0
- package/dist/production/core/MarkerMerger.js +2 -2
- package/dist/production/core/MutationGenerator.cjs +635 -0
- package/dist/production/core/MutationGenerator.cjs.map +1 -0
- package/dist/production/core/MutationGenerator.js +341 -294
- package/dist/production/core/MutationGenerator.js.map +1 -1
- package/dist/production/core/QueryGenerator.cjs +113 -0
- package/dist/production/core/QueryGenerator.cjs.map +1 -0
- package/dist/production/core/QueryGenerator.js +62 -75
- package/dist/production/core/QueryGenerator.js.map +1 -1
- package/dist/production/core/RealmKeyGenerator.cjs +47 -0
- package/dist/production/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/production/core/RequestResponseNormalizer.cjs +125 -0
- package/dist/production/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/production/core/StateInitializer.cjs +389 -0
- package/dist/production/core/StateInitializer.cjs.map +1 -0
- package/dist/production/core/StateInitializer.js +2 -2
- package/dist/production/core/StateInitializer.js.map +1 -1
- package/dist/production/core/TreeAugmenter.cjs +213 -0
- package/dist/production/core/TreeAugmenter.cjs.map +1 -0
- package/dist/production/core/TreeFilterGenerator.cjs +83 -0
- package/dist/production/core/TreeFilterGenerator.cjs.map +1 -0
- package/dist/production/core/TreeParameterMerger.cjs +304 -0
- package/dist/production/core/TreeParameterMerger.cjs.map +1 -0
- package/dist/production/core/TreeParameterMerger.js +8 -0
- package/dist/production/core/TreeParameterMerger.js.map +1 -1
- package/dist/production/core/TreeStore.cjs +182 -0
- package/dist/production/core/TreeStore.cjs.map +1 -0
- package/dist/production/core/TreeStore.js +1 -1
- package/dist/production/core/VariableInputTransformer.cjs +24 -0
- package/dist/production/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/production/core/exceptions/ErrorLocator.cjs +62 -0
- package/dist/production/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/production/core/exceptions/LocalizedBindingError.cjs +14 -0
- package/dist/production/core/exceptions/LocalizedBindingError.cjs.map +1 -0
- package/dist/production/core/exceptions/MarkerSugarer.cjs +56 -0
- package/dist/production/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/production/core/exceptions/TreeParameterSugarer.cjs +33 -0
- package/dist/production/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/production/core/factories/createBatchUpdatesOptions.cjs +20 -0
- package/dist/production/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/production/core/operations/EntityOperations.cjs +238 -0
- package/dist/production/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/production/core/operations/EntityOperations.js +1 -1
- package/dist/production/core/operations/FieldOperations.cjs +76 -0
- package/dist/production/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/production/core/operations/FieldOperations.js +1 -1
- package/dist/production/core/operations/ListOperations.cjs +159 -0
- package/dist/production/core/operations/ListOperations.cjs.map +1 -0
- package/dist/production/core/operations/OperationsHelpers.cjs +85 -0
- package/dist/production/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/production/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/production/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/production/core/schema/Schema.cjs +39 -0
- package/dist/production/core/schema/Schema.cjs.map +1 -0
- package/dist/production/core/schema/SchemaLoader.cjs +28 -0
- package/dist/production/core/schema/SchemaLoader.cjs.map +1 -0
- package/dist/production/core/schema/SchemaLoader.js +2 -2
- package/dist/production/core/schema/SchemaLoader.js.map +1 -1
- package/dist/production/core/schema/SchemaPreprocessor.cjs +38 -0
- package/dist/production/core/schema/SchemaPreprocessor.cjs.map +1 -0
- package/dist/production/core/state/StateIterator.cjs +100 -0
- package/dist/production/core/state/StateIterator.cjs.map +1 -0
- package/dist/production/core/state/getEntityMarker.cjs +5 -0
- package/dist/production/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/production/core/utils/createQueryBuilder.cjs +32 -0
- package/dist/production/core/utils/createQueryBuilder.cjs.map +1 -0
- package/dist/production/core/utils/createQueryBuilder.js +32 -0
- package/dist/production/core/utils/createQueryBuilder.js.map +1 -0
- package/dist/production/core/utils/getCombinedSignal.cjs +33 -0
- package/dist/production/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/production/dao/Environment.cjs +213 -0
- package/dist/production/dao/Environment.cjs.map +1 -0
- package/dist/production/dao/Environment.js.map +1 -1
- package/dist/production/dao/TreeNodeEnvironmentFactory.cjs +89 -0
- package/dist/production/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
- package/dist/production/dao/VariableFieldValue.cjs +9 -0
- package/dist/production/dao/VariableFieldValue.cjs.map +1 -0
- package/dist/production/fieldHelpers/helpers/FieldHelper.cjs +17 -0
- package/dist/production/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/production/index.cjs +124 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +18 -135
- package/dist/production/index.js.map +1 -1
- package/dist/production/markers/EntityFieldMarkersContainer.cjs +41 -0
- package/dist/production/markers/EntityFieldMarkersContainer.cjs.map +1 -0
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.cjs +11 -0
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
- package/dist/production/markers/EntityListSubTreeMarker.cjs +23 -0
- package/dist/production/markers/EntityListSubTreeMarker.cjs.map +1 -0
- package/dist/production/markers/EntitySubTreeMarker.cjs +23 -0
- package/dist/production/markers/EntitySubTreeMarker.cjs.map +1 -0
- package/dist/production/markers/FieldMarker.cjs +20 -0
- package/dist/production/markers/FieldMarker.cjs.map +1 -0
- package/dist/production/markers/HasManyRelationMarker.cjs +23 -0
- package/dist/production/markers/HasManyRelationMarker.cjs.map +1 -0
- package/dist/production/markers/HasOneRelationMarker.cjs +23 -0
- package/dist/production/markers/HasOneRelationMarker.cjs.map +1 -0
- package/dist/production/markers/MarkerTreeRoot.cjs +10 -0
- package/dist/production/markers/MarkerTreeRoot.cjs.map +1 -0
- package/dist/production/markers/ParentEntityMarker.cjs +10 -0
- package/dist/production/markers/ParentEntityMarker.cjs.map +1 -0
- package/dist/production/markers/PlaceholderGenerator.cjs +23 -0
- package/dist/production/markers/PlaceholderGenerator.cjs.map +1 -0
- package/dist/production/markers/PlaceholderParametersGenerator.cjs +62 -0
- package/dist/production/markers/PlaceholderParametersGenerator.cjs.map +1 -0
- package/dist/production/queryLanguage/CacheStore.cjs +47 -0
- package/dist/production/queryLanguage/CacheStore.cjs.map +1 -0
- package/dist/production/queryLanguage/CacheStore.js +2 -1
- package/dist/production/queryLanguage/CacheStore.js.map +1 -1
- package/dist/production/queryLanguage/MarkerFactory.cjs +200 -0
- package/dist/production/queryLanguage/MarkerFactory.cjs.map +1 -0
- package/dist/production/queryLanguage/MarkerFactory.js +1 -1
- package/dist/production/queryLanguage/Parser.cjs +725 -0
- package/dist/production/queryLanguage/Parser.cjs.map +1 -0
- package/dist/production/queryLanguage/Parser.js +64 -23
- package/dist/production/queryLanguage/Parser.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguage.cjs +517 -0
- package/dist/production/queryLanguage/QueryLanguage.cjs.map +1 -0
- package/dist/production/queryLanguage/QueryLanguage.js +3 -1
- package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguageError.cjs +6 -0
- package/dist/production/queryLanguage/QueryLanguageError.cjs.map +1 -0
- package/dist/production/queryLanguage/tokenList.cjs +150 -0
- package/dist/production/queryLanguage/tokenList.cjs.map +1 -0
- package/dist/production/queryLanguage/tokenList.js +1 -1
- package/dist/production/queryLanguage/tokenList.js.map +1 -1
- package/dist/production/structures/BijectiveIndexedMap.cjs +120 -0
- package/dist/production/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/production/structures/LRUCache.cjs +35 -0
- package/dist/production/structures/LRUCache.cjs.map +1 -0
- package/dist/production/structures/WeakIdCache.cjs +33 -0
- package/dist/production/structures/WeakIdCache.cjs.map +1 -0
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.cjs +22 -0
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
- package/dist/production/treeParameters/EntityCreationParameters.cjs +8 -0
- package/dist/production/treeParameters/EntityCreationParameters.cjs.map +1 -0
- package/dist/production/treeParameters/EntityListPreferences.cjs +7 -0
- package/dist/production/treeParameters/EntityListPreferences.cjs.map +1 -0
- package/dist/production/treeParameters/EventListenersStore.cjs +70 -0
- package/dist/production/treeParameters/EventListenersStore.cjs.map +1 -0
- package/dist/production/treeParameters/LeafField.cjs +7 -0
- package/dist/production/treeParameters/LeafField.cjs.map +1 -0
- package/dist/production/treeParameters/QualifiedEntityParameters.cjs +7 -0
- package/dist/production/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
- package/dist/production/treeParameters/Relation.cjs +7 -0
- package/dist/production/treeParameters/Relation.cjs.map +1 -0
- package/dist/production/utils/Hashing.cjs +22 -0
- package/dist/production/utils/Hashing.cjs.map +1 -0
- package/dist/production/utils/TreeNodeUtils.cjs +77 -0
- package/dist/production/utils/TreeNodeUtils.cjs.map +1 -0
- package/dist/production/utils/assert.cjs +11 -0
- package/dist/production/utils/assert.cjs.map +1 -0
- package/dist/production/utils/assertNever.cjs +10 -0
- package/dist/production/utils/assertNever.cjs.map +1 -0
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/production/utils/isEmptyObject.cjs +12 -0
- package/dist/production/utils/isEmptyObject.cjs.map +1 -0
- package/dist/production/utils/ucfirst.cjs +5 -0
- package/dist/production/utils/ucfirst.cjs.map +1 -0
- package/dist/types/accessorTree/PersistResult.d.ts +1 -2
- package/dist/types/accessorTree/PersistResult.d.ts.map +1 -1
- package/dist/types/accessorTree/index.d.ts +0 -15
- package/dist/types/accessorTree/index.d.ts.map +1 -1
- package/dist/types/accessors/BindingOperations.d.ts +2 -2
- package/dist/types/accessors/BindingOperations.d.ts.map +1 -1
- package/dist/types/accessors/ExtendTree.d.ts +1 -2
- package/dist/types/accessors/ExtendTree.d.ts.map +1 -1
- package/dist/types/accessors/TreeRootAccessor.d.ts +3 -3
- package/dist/types/accessors/TreeRootAccessor.d.ts.map +1 -1
- package/dist/types/core/AccessorErrorManager.d.ts +2 -2
- package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
- package/dist/types/core/DataBinding.d.ts +11 -6
- package/dist/types/core/DataBinding.d.ts.map +1 -1
- package/dist/types/core/ErrorsPreprocessor.d.ts +2 -2
- package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -1
- package/dist/types/core/EventManager.d.ts +2 -1
- package/dist/types/core/EventManager.d.ts.map +1 -1
- package/dist/types/core/MutationGenerator.d.ts +16 -13
- package/dist/types/core/MutationGenerator.d.ts.map +1 -1
- package/dist/types/core/QueryGenerator.d.ts +6 -8
- package/dist/types/core/QueryGenerator.d.ts.map +1 -1
- package/dist/types/core/TreeParameterMerger.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +7 -1
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/schema/index.d.ts +2 -0
- package/dist/types/core/schema/index.d.ts.map +1 -1
- package/dist/types/core/state/EntityListState.d.ts +2 -0
- package/dist/types/core/state/EntityListState.d.ts.map +1 -1
- package/dist/types/core/utils/createQueryBuilder.d.ts +4 -0
- package/dist/types/core/utils/createQueryBuilder.d.ts.map +1 -0
- package/dist/types/dao/Environment.d.ts +5 -2
- package/dist/types/dao/Environment.d.ts.map +1 -1
- package/dist/types/dao/index.d.ts +1 -0
- package/dist/types/dao/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/queryLanguage/CacheStore.d.ts.map +1 -1
- package/dist/types/queryLanguage/Parser.d.ts +3 -2
- package/dist/types/queryLanguage/Parser.d.ts.map +1 -1
- package/dist/types/queryLanguage/QueryLanguage.d.ts.map +1 -1
- package/dist/types/treeParameters/UnconstrainedQualifiedEntityList.d.ts +2 -0
- package/dist/types/treeParameters/UnconstrainedQualifiedEntityList.d.ts.map +1 -1
- package/dist/types/treeParameters/UnconstrainedQualifiedSingleEntity.d.ts +2 -0
- package/dist/types/treeParameters/UnconstrainedQualifiedSingleEntity.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -13
- package/src/accessorTree/PersistResult.ts +1 -2
- package/src/accessorTree/index.ts +0 -15
- package/src/accessors/BindingOperations.ts +2 -2
- package/src/accessors/ExtendTree.ts +1 -2
- package/src/accessors/TreeRootAccessor.ts +2 -2
- package/src/core/AccessorErrorManager.ts +11 -9
- package/src/core/DataBinding.ts +76 -75
- package/src/core/ErrorsPreprocessor.ts +24 -23
- package/src/core/EventManager.ts +6 -3
- package/src/core/MutationGenerator.ts +411 -412
- package/src/core/QueryGenerator.ts +66 -117
- package/src/core/StateInitializer.ts +2 -2
- package/src/core/TreeParameterMerger.ts +8 -0
- package/src/core/index.ts +7 -1
- package/src/core/schema/SchemaLoader.ts +2 -2
- package/src/core/schema/index.ts +2 -0
- package/src/core/state/EntityListState.ts +2 -0
- package/src/core/utils/createQueryBuilder.ts +31 -0
- package/src/dao/Environment.ts +6 -2
- package/src/dao/index.ts +1 -0
- package/src/index.ts +0 -5
- package/src/queryLanguage/CacheStore.ts +1 -0
- package/src/queryLanguage/Parser.ts +76 -37
- package/src/queryLanguage/QueryLanguage.ts +4 -1
- package/src/queryLanguage/tokenList.ts +1 -1
- package/src/treeParameters/UnconstrainedQualifiedEntityList.ts +2 -0
- package/src/treeParameters/UnconstrainedQualifiedSingleEntity.ts +2 -0
- package/src/tsconfig.json +1 -4
- package/dist/development/accessorPropagation/AccessorProvider.js +0 -18
- package/dist/development/accessorPropagation/AccessorProvider.js.map +0 -1
- package/dist/development/accessorPropagation/BindingOperationsContext.js +0 -31
- package/dist/development/accessorPropagation/BindingOperationsContext.js.map +0 -1
- package/dist/development/accessorPropagation/BindingOperationsProvider.js +0 -13
- package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +0 -1
- package/dist/development/accessorPropagation/EntityKeyContext.js +0 -7
- package/dist/development/accessorPropagation/EntityKeyContext.js.map +0 -1
- package/dist/development/accessorPropagation/EntityKeyProvider.js +0 -13
- package/dist/development/accessorPropagation/EntityKeyProvider.js.map +0 -1
- package/dist/development/accessorPropagation/EnvironmentContext.js +0 -53
- package/dist/development/accessorPropagation/EnvironmentContext.js.map +0 -1
- package/dist/development/accessorPropagation/TreeRootIdContext.js +0 -7
- package/dist/development/accessorPropagation/TreeRootIdContext.js.map +0 -1
- package/dist/development/accessorPropagation/TreeRootIdProvider.js +0 -13
- package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +0 -1
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js +0 -55
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js.map +0 -1
- package/dist/development/accessorPropagation/useBindingOperations.js +0 -7
- package/dist/development/accessorPropagation/useBindingOperations.js.map +0 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js +0 -47
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js.map +0 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js +0 -35
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +0 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js +0 -35
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js.map +0 -1
- package/dist/development/accessorPropagation/useEntity.js +0 -38
- package/dist/development/accessorPropagation/useEntity.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityKey.js +0 -16
- package/dist/development/accessorPropagation/useEntityKey.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityList.js +0 -36
- package/dist/development/accessorPropagation/useEntityList.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityListSubTree.js +0 -19
- package/dist/development/accessorPropagation/useEntityListSubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js +0 -69
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js.map +0 -1
- package/dist/development/accessorPropagation/useEntitySubTree.js +0 -19
- package/dist/development/accessorPropagation/useEntitySubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js +0 -47
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js.map +0 -1
- package/dist/development/accessorPropagation/useEnvironment.js +0 -9
- package/dist/development/accessorPropagation/useEnvironment.js.map +0 -1
- package/dist/development/accessorPropagation/useExtendTree.js +0 -32
- package/dist/development/accessorPropagation/useExtendTree.js.map +0 -1
- package/dist/development/accessorPropagation/useField.js +0 -36
- package/dist/development/accessorPropagation/useField.js.map +0 -1
- package/dist/development/accessorPropagation/useGetEntityByKey.js +0 -6
- package/dist/development/accessorPropagation/useGetEntityByKey.js.map +0 -1
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js +0 -17
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useGetEntitySubTree.js +0 -17
- package/dist/development/accessorPropagation/useGetEntitySubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useGetTreeFilters.js +0 -6
- package/dist/development/accessorPropagation/useGetTreeFilters.js.map +0 -1
- package/dist/development/accessorPropagation/useHasEntity.js +0 -9
- package/dist/development/accessorPropagation/useHasEntity.js.map +0 -1
- package/dist/development/accessorPropagation/usePersist.js +0 -6
- package/dist/development/accessorPropagation/usePersist.js.map +0 -1
- package/dist/development/accessorPropagation/useTreeRootId.js +0 -7
- package/dist/development/accessorPropagation/useTreeRootId.js.map +0 -1
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +0 -118
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +0 -1
- package/dist/development/accessorSorting/addEntityAtIndex.js +0 -18
- package/dist/development/accessorSorting/addEntityAtIndex.js.map +0 -1
- package/dist/development/accessorSorting/errors.js +0 -10
- package/dist/development/accessorSorting/errors.js.map +0 -1
- package/dist/development/accessorSorting/moveEntity.js +0 -42
- package/dist/development/accessorSorting/moveEntity.js.map +0 -1
- package/dist/development/accessorSorting/repairEntitiesOrder.js +0 -13
- package/dist/development/accessorSorting/repairEntitiesOrder.js.map +0 -1
- package/dist/development/accessorSorting/sortEntities.js +0 -17
- package/dist/development/accessorSorting/sortEntities.js.map +0 -1
- package/dist/development/accessorSorting/useSortedEntities.js +0 -80
- package/dist/development/accessorSorting/useSortedEntities.js.map +0 -1
- package/dist/development/accessorTree/AccessorTree.js +0 -39
- package/dist/development/accessorTree/AccessorTree.js.map +0 -1
- package/dist/development/accessorTree/AccessorTreeStateContext.js +0 -6
- package/dist/development/accessorTree/AccessorTreeStateContext.js.map +0 -1
- package/dist/development/accessorTree/DirtinessContext.js +0 -7
- package/dist/development/accessorTree/DirtinessContext.js.map +0 -1
- package/dist/development/accessorTree/MutationStateContext.js +0 -7
- package/dist/development/accessorTree/MutationStateContext.js.map +0 -1
- package/dist/development/accessorTree/accessorTreeStateReducer.js +0 -34
- package/dist/development/accessorTree/accessorTreeStateReducer.js.map +0 -1
- package/dist/development/accessorTree/metadataToRequestError.js +0 -15
- package/dist/development/accessorTree/metadataToRequestError.js.map +0 -1
- package/dist/development/accessorTree/useAccessorTreeState.js +0 -14
- package/dist/development/accessorTree/useAccessorTreeState.js.map +0 -1
- package/dist/development/accessorTree/useDataBinding.js +0 -84
- package/dist/development/accessorTree/useDataBinding.js.map +0 -1
- package/dist/development/accessorTree/useDirtinessState.js +0 -7
- package/dist/development/accessorTree/useDirtinessState.js.map +0 -1
- package/dist/development/accessorTree/useMutationState.js +0 -7
- package/dist/development/accessorTree/useMutationState.js.map +0 -1
- package/dist/development/core/IncrementalMarkerBuilder.js +0 -70
- package/dist/development/core/IncrementalMarkerBuilder.js.map +0 -1
- package/dist/development/core/MarkerTreeGenerator.js +0 -95
- package/dist/development/core/MarkerTreeGenerator.js.map +0 -1
- package/dist/development/coreComponents/Component.js +0 -33
- package/dist/development/coreComponents/Component.js.map +0 -1
- package/dist/development/coreComponents/DataBindingProvider.js +0 -24
- package/dist/development/coreComponents/DataBindingProvider.js.map +0 -1
- package/dist/development/coreComponents/Entity.js +0 -20
- package/dist/development/coreComponents/Entity.js.map +0 -1
- package/dist/development/coreComponents/EntityList.js +0 -45
- package/dist/development/coreComponents/EntityList.js.map +0 -1
- package/dist/development/coreComponents/EntityListSubTree.js +0 -58
- package/dist/development/coreComponents/EntityListSubTree.js.map +0 -1
- package/dist/development/coreComponents/EntitySubTree.js +0 -81
- package/dist/development/coreComponents/EntitySubTree.js.map +0 -1
- package/dist/development/coreComponents/Field.js +0 -37
- package/dist/development/coreComponents/Field.js.map +0 -1
- package/dist/development/coreComponents/HasMany.js +0 -42
- package/dist/development/coreComponents/HasMany.js.map +0 -1
- package/dist/development/coreComponents/HasOne.js +0 -42
- package/dist/development/coreComponents/HasOne.js.map +0 -1
- package/dist/development/coreComponents/ParentEntity.js +0 -18
- package/dist/development/coreComponents/ParentEntity.js.map +0 -1
- package/dist/development/entityEvents/useDerivedField.js +0 -42
- package/dist/development/entityEvents/useDerivedField.js.map +0 -1
- package/dist/development/entityEvents/useEntityBeforePersist.js +0 -8
- package/dist/development/entityEvents/useEntityBeforePersist.js.map +0 -1
- package/dist/development/entityEvents/useEntityBeforeUpdate.js +0 -8
- package/dist/development/entityEvents/useEntityBeforeUpdate.js.map +0 -1
- package/dist/development/entityEvents/useEntityEvent.js +0 -32
- package/dist/development/entityEvents/useEntityEvent.js.map +0 -1
- package/dist/development/entityEvents/useEntityPersistError.js +0 -8
- package/dist/development/entityEvents/useEntityPersistError.js.map +0 -1
- package/dist/development/entityEvents/useEntityPersistSuccess.js +0 -8
- package/dist/development/entityEvents/useEntityPersistSuccess.js.map +0 -1
- package/dist/development/entityEvents/useOnConnectionUpdate.js +0 -8
- package/dist/development/entityEvents/useOnConnectionUpdate.js.map +0 -1
- package/dist/development/helperComponents/DeferredSubTrees.js +0 -105
- package/dist/development/helperComponents/DeferredSubTrees.js.map +0 -1
- package/dist/development/helperComponents/EntityView.js +0 -14
- package/dist/development/helperComponents/EntityView.js.map +0 -1
- package/dist/development/helperComponents/FieldView.js +0 -61
- package/dist/development/helperComponents/FieldView.js.map +0 -1
- package/dist/development/helperComponents/If.js +0 -84
- package/dist/development/helperComponents/If.js.map +0 -1
- package/dist/development/helperComponents/StaticRender.js +0 -15
- package/dist/development/helperComponents/StaticRender.js.map +0 -1
- package/dist/development/helperComponents/SugaredField.js +0 -21
- package/dist/development/helperComponents/SugaredField.js.map +0 -1
- package/dist/development/helperComponents/helpers/FilterEvaluator.js +0 -37
- package/dist/development/helperComponents/helpers/FilterEvaluator.js.map +0 -1
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.js +0 -40
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.js.map +0 -1
- package/dist/development/helperComponents/helpers/evaluateCondition.js +0 -49
- package/dist/development/helperComponents/helpers/evaluateCondition.js.map +0 -1
- package/dist/production/accessorPropagation/AccessorProvider.js +0 -10
- package/dist/production/accessorPropagation/AccessorProvider.js.map +0 -1
- package/dist/production/accessorPropagation/BindingOperationsContext.js +0 -31
- package/dist/production/accessorPropagation/BindingOperationsContext.js.map +0 -1
- package/dist/production/accessorPropagation/BindingOperationsProvider.js +0 -9
- package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +0 -1
- package/dist/production/accessorPropagation/EntityKeyContext.js +0 -7
- package/dist/production/accessorPropagation/EntityKeyContext.js.map +0 -1
- package/dist/production/accessorPropagation/EntityKeyProvider.js +0 -9
- package/dist/production/accessorPropagation/EntityKeyProvider.js.map +0 -1
- package/dist/production/accessorPropagation/EnvironmentContext.js +0 -37
- package/dist/production/accessorPropagation/EnvironmentContext.js.map +0 -1
- package/dist/production/accessorPropagation/TreeRootIdContext.js +0 -7
- package/dist/production/accessorPropagation/TreeRootIdContext.js.map +0 -1
- package/dist/production/accessorPropagation/TreeRootIdProvider.js +0 -9
- package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +0 -1
- package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js +0 -55
- package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js.map +0 -1
- package/dist/production/accessorPropagation/useBindingOperations.js +0 -7
- package/dist/production/accessorPropagation/useBindingOperations.js.map +0 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js +0 -47
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js.map +0 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js +0 -35
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +0 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js +0 -35
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js.map +0 -1
- package/dist/production/accessorPropagation/useEntity.js +0 -38
- package/dist/production/accessorPropagation/useEntity.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityKey.js +0 -16
- package/dist/production/accessorPropagation/useEntityKey.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityList.js +0 -36
- package/dist/production/accessorPropagation/useEntityList.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityListSubTree.js +0 -19
- package/dist/production/accessorPropagation/useEntityListSubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js +0 -69
- package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js.map +0 -1
- package/dist/production/accessorPropagation/useEntitySubTree.js +0 -19
- package/dist/production/accessorPropagation/useEntitySubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useEntitySubTreeParameters.js +0 -47
- package/dist/production/accessorPropagation/useEntitySubTreeParameters.js.map +0 -1
- package/dist/production/accessorPropagation/useEnvironment.js +0 -9
- package/dist/production/accessorPropagation/useEnvironment.js.map +0 -1
- package/dist/production/accessorPropagation/useExtendTree.js +0 -32
- package/dist/production/accessorPropagation/useExtendTree.js.map +0 -1
- package/dist/production/accessorPropagation/useField.js +0 -36
- package/dist/production/accessorPropagation/useField.js.map +0 -1
- package/dist/production/accessorPropagation/useGetEntityByKey.js +0 -6
- package/dist/production/accessorPropagation/useGetEntityByKey.js.map +0 -1
- package/dist/production/accessorPropagation/useGetEntityListSubTree.js +0 -17
- package/dist/production/accessorPropagation/useGetEntityListSubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useGetEntitySubTree.js +0 -17
- package/dist/production/accessorPropagation/useGetEntitySubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useGetTreeFilters.js +0 -6
- package/dist/production/accessorPropagation/useGetTreeFilters.js.map +0 -1
- package/dist/production/accessorPropagation/useHasEntity.js +0 -9
- package/dist/production/accessorPropagation/useHasEntity.js.map +0 -1
- package/dist/production/accessorPropagation/usePersist.js +0 -6
- package/dist/production/accessorPropagation/usePersist.js.map +0 -1
- package/dist/production/accessorPropagation/useTreeRootId.js +0 -7
- package/dist/production/accessorPropagation/useTreeRootId.js.map +0 -1
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js +0 -74
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +0 -1
- package/dist/production/accessorSorting/addEntityAtIndex.js +0 -18
- package/dist/production/accessorSorting/addEntityAtIndex.js.map +0 -1
- package/dist/production/accessorSorting/errors.js +0 -10
- package/dist/production/accessorSorting/errors.js.map +0 -1
- package/dist/production/accessorSorting/moveEntity.js +0 -42
- package/dist/production/accessorSorting/moveEntity.js.map +0 -1
- package/dist/production/accessorSorting/repairEntitiesOrder.js +0 -13
- package/dist/production/accessorSorting/repairEntitiesOrder.js.map +0 -1
- package/dist/production/accessorSorting/sortEntities.js +0 -17
- package/dist/production/accessorSorting/sortEntities.js.map +0 -1
- package/dist/production/accessorSorting/useSortedEntities.js +0 -80
- package/dist/production/accessorSorting/useSortedEntities.js.map +0 -1
- package/dist/production/accessorTree/AccessorTree.js +0 -19
- package/dist/production/accessorTree/AccessorTree.js.map +0 -1
- package/dist/production/accessorTree/AccessorTreeStateContext.js +0 -6
- package/dist/production/accessorTree/AccessorTreeStateContext.js.map +0 -1
- package/dist/production/accessorTree/DirtinessContext.js +0 -7
- package/dist/production/accessorTree/DirtinessContext.js.map +0 -1
- package/dist/production/accessorTree/MutationStateContext.js +0 -7
- package/dist/production/accessorTree/MutationStateContext.js.map +0 -1
- package/dist/production/accessorTree/accessorTreeStateReducer.js +0 -34
- package/dist/production/accessorTree/accessorTreeStateReducer.js.map +0 -1
- package/dist/production/accessorTree/metadataToRequestError.js +0 -15
- package/dist/production/accessorTree/metadataToRequestError.js.map +0 -1
- package/dist/production/accessorTree/useAccessorTreeState.js +0 -14
- package/dist/production/accessorTree/useAccessorTreeState.js.map +0 -1
- package/dist/production/accessorTree/useDataBinding.js +0 -84
- package/dist/production/accessorTree/useDataBinding.js.map +0 -1
- package/dist/production/accessorTree/useDirtinessState.js +0 -7
- package/dist/production/accessorTree/useDirtinessState.js.map +0 -1
- package/dist/production/accessorTree/useMutationState.js +0 -7
- package/dist/production/accessorTree/useMutationState.js.map +0 -1
- package/dist/production/core/IncrementalMarkerBuilder.js +0 -70
- package/dist/production/core/IncrementalMarkerBuilder.js.map +0 -1
- package/dist/production/core/MarkerTreeGenerator.js +0 -95
- package/dist/production/core/MarkerTreeGenerator.js.map +0 -1
- package/dist/production/coreComponents/Component.js +0 -33
- package/dist/production/coreComponents/Component.js.map +0 -1
- package/dist/production/coreComponents/DataBindingProvider.js +0 -20
- package/dist/production/coreComponents/DataBindingProvider.js.map +0 -1
- package/dist/production/coreComponents/Entity.js +0 -16
- package/dist/production/coreComponents/Entity.js.map +0 -1
- package/dist/production/coreComponents/EntityList.js +0 -33
- package/dist/production/coreComponents/EntityList.js.map +0 -1
- package/dist/production/coreComponents/EntityListSubTree.js +0 -46
- package/dist/production/coreComponents/EntityListSubTree.js.map +0 -1
- package/dist/production/coreComponents/EntitySubTree.js +0 -57
- package/dist/production/coreComponents/EntitySubTree.js.map +0 -1
- package/dist/production/coreComponents/Field.js +0 -29
- package/dist/production/coreComponents/Field.js.map +0 -1
- package/dist/production/coreComponents/HasMany.js +0 -30
- package/dist/production/coreComponents/HasMany.js.map +0 -1
- package/dist/production/coreComponents/HasOne.js +0 -30
- package/dist/production/coreComponents/HasOne.js.map +0 -1
- package/dist/production/coreComponents/ParentEntity.js +0 -14
- package/dist/production/coreComponents/ParentEntity.js.map +0 -1
- package/dist/production/entityEvents/useDerivedField.js +0 -42
- package/dist/production/entityEvents/useDerivedField.js.map +0 -1
- package/dist/production/entityEvents/useEntityBeforePersist.js +0 -8
- package/dist/production/entityEvents/useEntityBeforePersist.js.map +0 -1
- package/dist/production/entityEvents/useEntityBeforeUpdate.js +0 -8
- package/dist/production/entityEvents/useEntityBeforeUpdate.js.map +0 -1
- package/dist/production/entityEvents/useEntityEvent.js +0 -32
- package/dist/production/entityEvents/useEntityEvent.js.map +0 -1
- package/dist/production/entityEvents/useEntityPersistError.js +0 -8
- package/dist/production/entityEvents/useEntityPersistError.js.map +0 -1
- package/dist/production/entityEvents/useEntityPersistSuccess.js +0 -8
- package/dist/production/entityEvents/useEntityPersistSuccess.js.map +0 -1
- package/dist/production/entityEvents/useOnConnectionUpdate.js +0 -8
- package/dist/production/entityEvents/useOnConnectionUpdate.js.map +0 -1
- package/dist/production/helperComponents/DeferredSubTrees.js +0 -89
- package/dist/production/helperComponents/DeferredSubTrees.js.map +0 -1
- package/dist/production/helperComponents/EntityView.js +0 -10
- package/dist/production/helperComponents/EntityView.js.map +0 -1
- package/dist/production/helperComponents/FieldView.js +0 -49
- package/dist/production/helperComponents/FieldView.js.map +0 -1
- package/dist/production/helperComponents/If.js +0 -52
- package/dist/production/helperComponents/If.js.map +0 -1
- package/dist/production/helperComponents/StaticRender.js +0 -11
- package/dist/production/helperComponents/StaticRender.js.map +0 -1
- package/dist/production/helperComponents/SugaredField.js +0 -13
- package/dist/production/helperComponents/SugaredField.js.map +0 -1
- package/dist/production/helperComponents/helpers/FilterEvaluator.js +0 -37
- package/dist/production/helperComponents/helpers/FilterEvaluator.js.map +0 -1
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.js +0 -40
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.js.map +0 -1
- package/dist/production/helperComponents/helpers/evaluateCondition.js +0 -49
- package/dist/production/helperComponents/helpers/evaluateCondition.js.map +0 -1
- package/dist/types/accessorPropagation/AccessorProvider.d.ts +0 -8
- package/dist/types/accessorPropagation/AccessorProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +0 -4
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts +0 -8
- package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts +0 -2
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts +0 -7
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts +0 -15
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +0 -2
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts +0 -8
- package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/index.d.ts +0 -28
- package/dist/types/accessorPropagation/index.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts +0 -16
- package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useBindingOperations.d.ts +0 -3
- package/dist/types/accessorPropagation/useBindingOperations.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts +0 -11
- package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts +0 -11
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts +0 -11
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntity.d.ts +0 -7
- package/dist/types/accessorPropagation/useEntity.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityKey.d.ts +0 -2
- package/dist/types/accessorPropagation/useEntityKey.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityList.d.ts +0 -6
- package/dist/types/accessorPropagation/useEntityList.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityListSubTree.d.ts +0 -6
- package/dist/types/accessorPropagation/useEntityListSubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityListSubTreeParameters.d.ts +0 -5
- package/dist/types/accessorPropagation/useEntityListSubTreeParameters.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts +0 -6
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntitySubTreeParameters.d.ts +0 -5
- package/dist/types/accessorPropagation/useEntitySubTreeParameters.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEnvironment.d.ts +0 -3
- package/dist/types/accessorPropagation/useEnvironment.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useExtendTree.d.ts +0 -5
- package/dist/types/accessorPropagation/useExtendTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useField.d.ts +0 -6
- package/dist/types/accessorPropagation/useField.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetEntityByKey.d.ts +0 -3
- package/dist/types/accessorPropagation/useGetEntityByKey.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts +0 -5
- package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts +0 -5
- package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetTreeFilters.d.ts +0 -3
- package/dist/types/accessorPropagation/useGetTreeFilters.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useHasEntity.d.ts +0 -2
- package/dist/types/accessorPropagation/useHasEntity.d.ts.map +0 -1
- package/dist/types/accessorPropagation/usePersist.d.ts +0 -3
- package/dist/types/accessorPropagation/usePersist.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useTreeRootId.d.ts +0 -3
- package/dist/types/accessorPropagation/useTreeRootId.d.ts.map +0 -1
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +0 -9
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +0 -1
- package/dist/types/accessorSorting/SortedEntities.d.ts +0 -9
- package/dist/types/accessorSorting/SortedEntities.d.ts.map +0 -1
- package/dist/types/accessorSorting/addEntityAtIndex.d.ts +0 -4
- package/dist/types/accessorSorting/addEntityAtIndex.d.ts.map +0 -1
- package/dist/types/accessorSorting/errors.d.ts +0 -3
- package/dist/types/accessorSorting/errors.d.ts.map +0 -1
- package/dist/types/accessorSorting/index.d.ts +0 -8
- package/dist/types/accessorSorting/index.d.ts.map +0 -1
- package/dist/types/accessorSorting/moveEntity.d.ts +0 -5
- package/dist/types/accessorSorting/moveEntity.d.ts.map +0 -1
- package/dist/types/accessorSorting/repairEntitiesOrder.d.ts +0 -4
- package/dist/types/accessorSorting/repairEntitiesOrder.d.ts.map +0 -1
- package/dist/types/accessorSorting/sortEntities.d.ts +0 -4
- package/dist/types/accessorSorting/sortEntities.d.ts.map +0 -1
- package/dist/types/accessorSorting/useSortedEntities.d.ts +0 -5
- package/dist/types/accessorSorting/useSortedEntities.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTree.d.ts +0 -14
- package/dist/types/accessorTree/AccessorTree.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeState.d.ts +0 -23
- package/dist/types/accessorTree/AccessorTreeState.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateAction.d.ts +0 -18
- package/dist/types/accessorTree/AccessorTreeStateAction.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +0 -3
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateMetadata.d.ts +0 -4
- package/dist/types/accessorTree/AccessorTreeStateMetadata.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts +0 -7
- package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts.map +0 -1
- package/dist/types/accessorTree/DirtinessContext.d.ts +0 -2
- package/dist/types/accessorTree/DirtinessContext.d.ts.map +0 -1
- package/dist/types/accessorTree/MutationRequestResponse.d.ts +0 -52
- package/dist/types/accessorTree/MutationRequestResponse.d.ts.map +0 -1
- package/dist/types/accessorTree/MutationStateContext.d.ts +0 -2
- package/dist/types/accessorTree/MutationStateContext.d.ts.map +0 -1
- package/dist/types/accessorTree/RequestError.d.ts +0 -21
- package/dist/types/accessorTree/RequestError.d.ts.map +0 -1
- package/dist/types/accessorTree/accessorTreeStateReducer.d.ts +0 -4
- package/dist/types/accessorTree/accessorTreeStateReducer.d.ts.map +0 -1
- package/dist/types/accessorTree/metadataToRequestError.d.ts +0 -4
- package/dist/types/accessorTree/metadataToRequestError.d.ts.map +0 -1
- package/dist/types/accessorTree/useAccessorTreeState.d.ts +0 -2
- package/dist/types/accessorTree/useAccessorTreeState.d.ts.map +0 -1
- package/dist/types/accessorTree/useDataBinding.d.ts +0 -4
- package/dist/types/accessorTree/useDataBinding.d.ts.map +0 -1
- package/dist/types/accessorTree/useDirtinessState.d.ts +0 -2
- package/dist/types/accessorTree/useDirtinessState.d.ts.map +0 -1
- package/dist/types/accessorTree/useMutationState.d.ts +0 -2
- package/dist/types/accessorTree/useMutationState.d.ts.map +0 -1
- package/dist/types/core/IncrementalMarkerBuilder.d.ts +0 -7
- package/dist/types/core/IncrementalMarkerBuilder.d.ts.map +0 -1
- package/dist/types/core/MarkerTreeGenerator.d.ts +0 -14
- package/dist/types/core/MarkerTreeGenerator.d.ts.map +0 -1
- package/dist/types/coreComponents/Component.d.ts +0 -13
- package/dist/types/coreComponents/Component.d.ts.map +0 -1
- package/dist/types/coreComponents/DataBindingProvider.d.ts +0 -27
- package/dist/types/coreComponents/DataBindingProvider.d.ts.map +0 -1
- package/dist/types/coreComponents/Entity.d.ts +0 -12
- package/dist/types/coreComponents/Entity.d.ts.map +0 -1
- package/dist/types/coreComponents/EntityList.d.ts +0 -15
- package/dist/types/coreComponents/EntityList.d.ts.map +0 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts +0 -26
- package/dist/types/coreComponents/EntityListSubTree.d.ts.map +0 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts +0 -24
- package/dist/types/coreComponents/EntitySubTree.d.ts.map +0 -1
- package/dist/types/coreComponents/Field.d.ts +0 -14
- package/dist/types/coreComponents/Field.d.ts.map +0 -1
- package/dist/types/coreComponents/HasMany.d.ts +0 -16
- package/dist/types/coreComponents/HasMany.d.ts.map +0 -1
- package/dist/types/coreComponents/HasOne.d.ts +0 -12
- package/dist/types/coreComponents/HasOne.d.ts.map +0 -1
- package/dist/types/coreComponents/MarkerProvider.d.ts +0 -21
- package/dist/types/coreComponents/MarkerProvider.d.ts.map +0 -1
- package/dist/types/coreComponents/ParentEntity.d.ts +0 -10
- package/dist/types/coreComponents/ParentEntity.d.ts.map +0 -1
- package/dist/types/coreComponents/index.d.ts +0 -12
- package/dist/types/coreComponents/index.d.ts.map +0 -1
- package/dist/types/entityEvents/index.d.ts +0 -8
- package/dist/types/entityEvents/index.d.ts.map +0 -1
- package/dist/types/entityEvents/useDerivedField.d.ts +0 -9
- package/dist/types/entityEvents/useDerivedField.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityBeforePersist.d.ts +0 -3
- package/dist/types/entityEvents/useEntityBeforePersist.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityBeforeUpdate.d.ts +0 -3
- package/dist/types/entityEvents/useEntityBeforeUpdate.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityEvent.d.ts +0 -9
- package/dist/types/entityEvents/useEntityEvent.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityPersistError.d.ts +0 -3
- package/dist/types/entityEvents/useEntityPersistError.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityPersistSuccess.d.ts +0 -3
- package/dist/types/entityEvents/useEntityPersistSuccess.d.ts.map +0 -1
- package/dist/types/entityEvents/useOnConnectionUpdate.d.ts +0 -4
- package/dist/types/entityEvents/useOnConnectionUpdate.d.ts.map +0 -1
- package/dist/types/helperComponents/DeferredSubTrees.d.ts +0 -10
- package/dist/types/helperComponents/DeferredSubTrees.d.ts.map +0 -1
- package/dist/types/helperComponents/EntityView.d.ts +0 -12
- package/dist/types/helperComponents/EntityView.d.ts.map +0 -1
- package/dist/types/helperComponents/FieldView.d.ts +0 -59
- package/dist/types/helperComponents/FieldView.d.ts.map +0 -1
- package/dist/types/helperComponents/If.d.ts +0 -17
- package/dist/types/helperComponents/If.d.ts.map +0 -1
- package/dist/types/helperComponents/StaticRender.d.ts +0 -9
- package/dist/types/helperComponents/StaticRender.d.ts.map +0 -1
- package/dist/types/helperComponents/SugaredField.d.ts +0 -12
- package/dist/types/helperComponents/SugaredField.d.ts.map +0 -1
- package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts +0 -9
- package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts.map +0 -1
- package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts +0 -10
- package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts.map +0 -1
- package/dist/types/helperComponents/helpers/evaluateCondition.d.ts +0 -4
- package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +0 -1
- package/dist/types/helperComponents/index.d.ts +0 -7
- package/dist/types/helperComponents/index.d.ts.map +0 -1
- package/src/accessorPropagation/AccessorProvider.tsx +0 -17
- package/src/accessorPropagation/BindingOperationsContext.ts +0 -32
- package/src/accessorPropagation/BindingOperationsProvider.tsx +0 -16
- package/src/accessorPropagation/EntityKeyContext.ts +0 -4
- package/src/accessorPropagation/EntityKeyProvider.tsx +0 -11
- package/src/accessorPropagation/EnvironmentContext.tsx +0 -44
- package/src/accessorPropagation/TreeRootIdContext.ts +0 -5
- package/src/accessorPropagation/TreeRootIdProvider.tsx +0 -12
- package/src/accessorPropagation/index.ts +0 -30
- package/src/accessorPropagation/useAccessorUpdateSubscription.ts +0 -107
- package/src/accessorPropagation/useBindingOperations.ts +0 -5
- package/src/accessorPropagation/useDesugaredRelativeEntityList.ts +0 -70
- package/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +0 -58
- package/src/accessorPropagation/useDesugaredRelativeSingleField.ts +0 -58
- package/src/accessorPropagation/useEntity.ts +0 -56
- package/src/accessorPropagation/useEntityKey.ts +0 -15
- package/src/accessorPropagation/useEntityList.ts +0 -49
- package/src/accessorPropagation/useEntityListSubTree.ts +0 -27
- package/src/accessorPropagation/useEntityListSubTreeParameters.ts +0 -88
- package/src/accessorPropagation/useEntitySubTree.ts +0 -26
- package/src/accessorPropagation/useEntitySubTreeParameters.ts +0 -66
- package/src/accessorPropagation/useEnvironment.ts +0 -7
- package/src/accessorPropagation/useExtendTree.ts +0 -30
- package/src/accessorPropagation/useField.ts +0 -51
- package/src/accessorPropagation/useGetEntityByKey.ts +0 -4
- package/src/accessorPropagation/useGetEntityListSubTree.ts +0 -28
- package/src/accessorPropagation/useGetEntitySubTree.ts +0 -28
- package/src/accessorPropagation/useGetTreeFilters.ts +0 -4
- package/src/accessorPropagation/useHasEntity.ts +0 -6
- package/src/accessorPropagation/usePersist.ts +0 -4
- package/src/accessorPropagation/useTreeRootId.ts +0 -5
- package/src/accessorSorting/SetOrderFieldOnCreate.tsx +0 -92
- package/src/accessorSorting/SortedEntities.ts +0 -9
- package/src/accessorSorting/addEntityAtIndex.ts +0 -27
- package/src/accessorSorting/errors.ts +0 -9
- package/src/accessorSorting/index.ts +0 -9
- package/src/accessorSorting/moveEntity.ts +0 -66
- package/src/accessorSorting/repairEntitiesOrder.ts +0 -15
- package/src/accessorSorting/sortEntities.ts +0 -20
- package/src/accessorSorting/useSortedEntities.ts +0 -102
- package/src/accessorTree/AccessorTree.tsx +0 -37
- package/src/accessorTree/AccessorTreeState.ts +0 -29
- package/src/accessorTree/AccessorTreeStateAction.ts +0 -21
- package/src/accessorTree/AccessorTreeStateContext.ts +0 -4
- package/src/accessorTree/AccessorTreeStateMetadata.ts +0 -3
- package/src/accessorTree/AccessorTreeStateOptions.ts +0 -7
- package/src/accessorTree/DirtinessContext.ts +0 -4
- package/src/accessorTree/MutationRequestResponse.ts +0 -64
- package/src/accessorTree/MutationStateContext.ts +0 -4
- package/src/accessorTree/RequestError.ts +0 -22
- package/src/accessorTree/accessorTreeStateReducer.ts +0 -36
- package/src/accessorTree/metadataToRequestError.ts +0 -14
- package/src/accessorTree/useAccessorTreeState.ts +0 -11
- package/src/accessorTree/useDataBinding.ts +0 -104
- package/src/accessorTree/useDirtinessState.ts +0 -4
- package/src/accessorTree/useMutationState.ts +0 -4
- package/src/core/IncrementalMarkerBuilder.ts +0 -60
- package/src/core/MarkerTreeGenerator.ts +0 -121
- package/src/coreComponents/Component.tsx +0 -74
- package/src/coreComponents/DataBindingProvider.tsx +0 -54
- package/src/coreComponents/Entity.tsx +0 -26
- package/src/coreComponents/EntityList.tsx +0 -55
- package/src/coreComponents/EntityListSubTree.tsx +0 -83
- package/src/coreComponents/EntitySubTree.tsx +0 -93
- package/src/coreComponents/Field.tsx +0 -46
- package/src/coreComponents/HasMany.tsx +0 -47
- package/src/coreComponents/HasOne.tsx +0 -41
- package/src/coreComponents/MarkerProvider.ts +0 -59
- package/src/coreComponents/ParentEntity.tsx +0 -20
- package/src/coreComponents/index.ts +0 -11
- package/src/entityEvents/index.ts +0 -7
- package/src/entityEvents/useDerivedField.ts +0 -64
- package/src/entityEvents/useEntityBeforePersist.ts +0 -6
- package/src/entityEvents/useEntityBeforeUpdate.ts +0 -6
- package/src/entityEvents/useEntityEvent.ts +0 -57
- package/src/entityEvents/useEntityPersistError.ts +0 -6
- package/src/entityEvents/useEntityPersistSuccess.ts +0 -6
- package/src/entityEvents/useOnConnectionUpdate.ts +0 -10
- package/src/helperComponents/DeferredSubTrees.tsx +0 -126
- package/src/helperComponents/EntityView.tsx +0 -19
- package/src/helperComponents/FieldView.tsx +0 -142
- package/src/helperComponents/If.tsx +0 -74
- package/src/helperComponents/StaticRender.tsx +0 -15
- package/src/helperComponents/SugaredField.tsx +0 -18
- package/src/helperComponents/helpers/FilterEvaluator.ts +0 -46
- package/src/helperComponents/helpers/FilterFieldsCollector.ts +0 -46
- package/src/helperComponents/helpers/evaluateCondition.ts +0 -52
- package/src/helperComponents/index.ts +0 -6
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => {
|
|
5
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
const BindingError = require("../BindingError.cjs");
|
|
10
|
+
const getEntityMarker = require("./state/getEntityMarker.cjs");
|
|
11
|
+
const StateIterator = require("./state/StateIterator.cjs");
|
|
12
|
+
const assertNever = require("../utils/assertNever.cjs");
|
|
13
|
+
class EventManager {
|
|
14
|
+
constructor(asyncBatchUpdatesOptions, batchUpdatesOptions, config, dirtinessTracker, onUpdate, treeStore, batchedUpdates) {
|
|
15
|
+
__publicField(this, "transactionDepth", 0);
|
|
16
|
+
__publicField(this, "isFrozenWhileUpdating", false);
|
|
17
|
+
// This should ideally not exists as it should be synonymous to `this.ongoingPersistOperation !== undefined`
|
|
18
|
+
// but it makes persist-related promise juggling significantly more straightforward.
|
|
19
|
+
__publicField(this, "isMutating", false);
|
|
20
|
+
__publicField(this, "ongoingPersistOperation");
|
|
21
|
+
__publicField(this, "previousMetadata");
|
|
22
|
+
__publicField(this, "newlyInitializedWithListeners", /* @__PURE__ */ new Set());
|
|
23
|
+
__publicField(this, "pendingWithBeforeUpdate", /* @__PURE__ */ new Set());
|
|
24
|
+
__publicField(this, "rootsWithPendingUpdates", /* @__PURE__ */ new Set());
|
|
25
|
+
this.asyncBatchUpdatesOptions = asyncBatchUpdatesOptions;
|
|
26
|
+
this.batchUpdatesOptions = batchUpdatesOptions;
|
|
27
|
+
this.config = config;
|
|
28
|
+
this.dirtinessTracker = dirtinessTracker;
|
|
29
|
+
this.onUpdate = onUpdate;
|
|
30
|
+
this.treeStore = treeStore;
|
|
31
|
+
this.batchedUpdates = batchedUpdates;
|
|
32
|
+
}
|
|
33
|
+
async persistOperation(operation) {
|
|
34
|
+
if (this.transactionDepth > 0) {
|
|
35
|
+
throw new BindingError.BindingError(`Cannot trigger a persist whilst batching updates!`);
|
|
36
|
+
}
|
|
37
|
+
const ongoingOperation = this.ongoingPersistOperation;
|
|
38
|
+
if (ongoingOperation !== void 0) {
|
|
39
|
+
return await ongoingOperation;
|
|
40
|
+
}
|
|
41
|
+
return await (this.ongoingPersistOperation = new Promise(async (resolve, reject) => {
|
|
42
|
+
this.isMutating = true;
|
|
43
|
+
this.flushUpdates();
|
|
44
|
+
try {
|
|
45
|
+
resolve(await this.asyncOperation(operation));
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.error("PersistError", e);
|
|
48
|
+
reject(e);
|
|
49
|
+
} finally {
|
|
50
|
+
this.ongoingPersistOperation = void 0;
|
|
51
|
+
this.isMutating = false;
|
|
52
|
+
this.flushUpdates();
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
syncTransaction(transaction) {
|
|
57
|
+
try {
|
|
58
|
+
this.transactionDepth++;
|
|
59
|
+
return transaction();
|
|
60
|
+
} finally {
|
|
61
|
+
this.transactionDepth--;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
syncOperation(operation) {
|
|
65
|
+
const result = this.syncTransaction(operation);
|
|
66
|
+
this.flushUpdates();
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
async asyncTransaction(transaction) {
|
|
70
|
+
try {
|
|
71
|
+
this.transactionDepth++;
|
|
72
|
+
return await transaction();
|
|
73
|
+
} finally {
|
|
74
|
+
this.transactionDepth--;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async asyncOperation(operation) {
|
|
78
|
+
const result = await this.asyncTransaction(operation);
|
|
79
|
+
this.flushUpdates();
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
flushUpdates() {
|
|
83
|
+
if (this.transactionDepth > 0) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (this.isFrozenWhileUpdating) {
|
|
87
|
+
throw new BindingError.BindingError(
|
|
88
|
+
`Trying to perform an update while the whole accessor tree is already updating. This is most likely caused by updating the accessor tree while rendering or from within the 'update' event handler, which is a no-op. If you wish to mutate the tree in reaction to other changes, use the 'beforeUpdate' event.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
const newMetadata = this.getNewUpdateMetadata();
|
|
92
|
+
if (!this.shouldFlushUpdates(newMetadata)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.batchedUpdates(() => {
|
|
96
|
+
this.isFrozenWhileUpdating = true;
|
|
97
|
+
this.triggerBeforeFlushEvents();
|
|
98
|
+
this.onUpdate(newMetadata);
|
|
99
|
+
this.flushPendingAccessorUpdates(Array.from(this.rootsWithPendingUpdates));
|
|
100
|
+
this.rootsWithPendingUpdates.clear();
|
|
101
|
+
this.isFrozenWhileUpdating = false;
|
|
102
|
+
this.previousMetadata = newMetadata;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
getNewUpdateMetadata() {
|
|
106
|
+
return {
|
|
107
|
+
isMutating: this.isMutating
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
shouldFlushUpdates(newMetadata) {
|
|
111
|
+
if (this.transactionDepth > 0) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (this.previousMetadata === void 0) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
if (this.rootsWithPendingUpdates.size) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
for (const key in newMetadata) {
|
|
121
|
+
const fromPrevious = this.previousMetadata[key];
|
|
122
|
+
const fromNew = newMetadata[key];
|
|
123
|
+
if (!Object.is(fromPrevious, fromNew)) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
registerNewlyInitialized(newlyInitialized) {
|
|
130
|
+
const initializeListeners = this.getEventListeners(newlyInitialized, { type: "initialize" });
|
|
131
|
+
if (initializeListeners === void 0) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this.newlyInitializedWithListeners.add(newlyInitialized);
|
|
135
|
+
if (this.transactionDepth === 0) {
|
|
136
|
+
this.triggerOnInitialize();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
registerUpdatedConnection(parentState, placeholderName) {
|
|
140
|
+
if (parentState.fieldsWithPendingConnectionUpdates === void 0) {
|
|
141
|
+
parentState.fieldsWithPendingConnectionUpdates = /* @__PURE__ */ new Set();
|
|
142
|
+
}
|
|
143
|
+
const marker = getEntityMarker.getEntityMarker(parentState);
|
|
144
|
+
placeholders:
|
|
145
|
+
for (const [fieldName, placeholdersByField] of marker.fields.placeholders) {
|
|
146
|
+
if (typeof placeholdersByField === "string") {
|
|
147
|
+
if (placeholdersByField === placeholderName) {
|
|
148
|
+
parentState.fieldsWithPendingConnectionUpdates.add(fieldName);
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
for (const placeholderByFieldName of placeholdersByField) {
|
|
152
|
+
if (placeholderByFieldName === placeholderName) {
|
|
153
|
+
parentState.fieldsWithPendingConnectionUpdates.add(fieldName);
|
|
154
|
+
continue placeholders;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
registerJustUpdated(justUpdated, changesDelta) {
|
|
161
|
+
const beforeUpdateListeners = this.getEventListeners(justUpdated, { type: "beforeUpdate" });
|
|
162
|
+
if (beforeUpdateListeners !== void 0) {
|
|
163
|
+
this.pendingWithBeforeUpdate.add(justUpdated);
|
|
164
|
+
}
|
|
165
|
+
justUpdated.accessor = void 0;
|
|
166
|
+
switch (justUpdated.type) {
|
|
167
|
+
case "entityRealm":
|
|
168
|
+
case "entityList": {
|
|
169
|
+
justUpdated.unpersistedChangesCount += changesDelta;
|
|
170
|
+
const parent = justUpdated.blueprint.parent;
|
|
171
|
+
if (parent === void 0) {
|
|
172
|
+
this.rootsWithPendingUpdates.add(justUpdated);
|
|
173
|
+
if (!(justUpdated.blueprint.type === "subTree" && justUpdated.blueprint.marker.parameters.isCreating && justUpdated.blueprint.marker.parameters.isUnpersisted)) {
|
|
174
|
+
this.dirtinessTracker.increaseBy(changesDelta);
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
if (!parent.childrenWithPendingUpdates) {
|
|
178
|
+
parent.childrenWithPendingUpdates = /* @__PURE__ */ new Set();
|
|
179
|
+
}
|
|
180
|
+
parent.childrenWithPendingUpdates.add(justUpdated);
|
|
181
|
+
this.registerJustUpdated(parent, changesDelta);
|
|
182
|
+
}
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
case "field": {
|
|
186
|
+
const parent = justUpdated.parent;
|
|
187
|
+
if (!parent.childrenWithPendingUpdates) {
|
|
188
|
+
parent.childrenWithPendingUpdates = /* @__PURE__ */ new Set();
|
|
189
|
+
}
|
|
190
|
+
parent.childrenWithPendingUpdates.add(justUpdated);
|
|
191
|
+
this.registerJustUpdated(justUpdated.parent, changesDelta);
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
flushPendingAccessorUpdates(rootStates) {
|
|
197
|
+
const agenda = rootStates;
|
|
198
|
+
for (const state of agenda) {
|
|
199
|
+
const updateListeners = state.type === "field" ? this.getEventDispatchers(state, { type: "update" }, [state.getAccessor()]) : state.type === "entityRealm" ? this.getEventDispatchers(state, { type: "update" }, [state.getAccessor()]) : this.getEventDispatchers(state, { type: "update" }, [state.getAccessor()]);
|
|
200
|
+
if (updateListeners !== void 0) {
|
|
201
|
+
for (const handler of updateListeners) {
|
|
202
|
+
handler();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (state.type === "entityRealm" && state.fieldsWithPendingConnectionUpdates) {
|
|
206
|
+
for (const updatedField of state.fieldsWithPendingConnectionUpdates) {
|
|
207
|
+
const listeners = this.getEventListeners(state, { type: "connectionUpdate", key: updatedField });
|
|
208
|
+
if (!listeners) {
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
for (const listener of listeners) {
|
|
212
|
+
listener(state.getAccessor());
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
switch (state.type) {
|
|
217
|
+
case "entityRealm":
|
|
218
|
+
case "entityList": {
|
|
219
|
+
if (state.childrenWithPendingUpdates !== void 0) {
|
|
220
|
+
for (const childState of state.childrenWithPendingUpdates) {
|
|
221
|
+
agenda.push(childState);
|
|
222
|
+
}
|
|
223
|
+
state.childrenWithPendingUpdates.clear();
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
case "field":
|
|
228
|
+
break;
|
|
229
|
+
default:
|
|
230
|
+
assertNever.assertNever();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
async triggerAsyncMutatingEvent(eventType, options) {
|
|
235
|
+
await this.asyncTransaction(async () => {
|
|
236
|
+
const callbackQueue = [];
|
|
237
|
+
for (const [, subTreeState] of StateIterator.StateIterator.eachRootState(this.treeStore)) {
|
|
238
|
+
for (const iNode of StateIterator.StateIterator.depthFirstINodes(subTreeState)) {
|
|
239
|
+
const listeners = this.getEventListeners(iNode, { type: eventType }) ?? [];
|
|
240
|
+
for (const listener of listeners) {
|
|
241
|
+
callbackQueue.push([iNode, listener]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
for (let waterfallDepth = 0; waterfallDepth < this.config.getValue(`${eventType}SettleLimit`); waterfallDepth++) {
|
|
246
|
+
const promiseReturns = [];
|
|
247
|
+
const correspondingStates = [];
|
|
248
|
+
if (callbackQueue.length === 0) {
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
for (const [state, callback] of callbackQueue) {
|
|
252
|
+
correspondingStates.push(state);
|
|
253
|
+
const changesCountBefore2 = this.dirtinessTracker.getTotalTouchCount();
|
|
254
|
+
let validateChanges = false;
|
|
255
|
+
try {
|
|
256
|
+
const result = callback(state.getAccessor, options);
|
|
257
|
+
if (result instanceof Promise) {
|
|
258
|
+
validateChanges = true;
|
|
259
|
+
promiseReturns.push(result);
|
|
260
|
+
} else {
|
|
261
|
+
promiseReturns.push(Promise.resolve(result));
|
|
262
|
+
}
|
|
263
|
+
} catch (e) {
|
|
264
|
+
promiseReturns.push(Promise.reject(e));
|
|
265
|
+
}
|
|
266
|
+
if (validateChanges) {
|
|
267
|
+
this.validateWithoutChanges(changesCountBefore2, eventType);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const changesCountBefore = this.dirtinessTracker.getTotalTouchCount();
|
|
271
|
+
const newCallbacks = await Promise.allSettled(promiseReturns);
|
|
272
|
+
this.validateWithoutChanges(changesCountBefore, eventType);
|
|
273
|
+
callbackQueue.length = 0;
|
|
274
|
+
for (const newlyInitialized of this.newlyInitializedWithListeners) {
|
|
275
|
+
if (newlyInitialized.type === "field") {
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
const beforePersistHandlers = this.getEventListeners(newlyInitialized, { type: eventType });
|
|
279
|
+
if (beforePersistHandlers) {
|
|
280
|
+
for (const listener of beforePersistHandlers) {
|
|
281
|
+
callbackQueue.push([newlyInitialized, listener]);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
this.triggerBeforeFlushEvents();
|
|
286
|
+
this.handleRejections(eventType, newCallbacks);
|
|
287
|
+
for (let i = 0; i < newCallbacks.length; i++) {
|
|
288
|
+
const result = newCallbacks[i];
|
|
289
|
+
const correspondingState = correspondingStates[i];
|
|
290
|
+
if (result.status === "fulfilled") {
|
|
291
|
+
if (typeof result.value === "function") {
|
|
292
|
+
callbackQueue.push([correspondingState, result.value]);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
triggerBeforeFlushEvents() {
|
|
300
|
+
this.syncTransaction(() => {
|
|
301
|
+
const settleLimit = this.config.getValue("beforeUpdateSettleLimit");
|
|
302
|
+
for (let attemptNumber = 0; attemptNumber < settleLimit; attemptNumber++) {
|
|
303
|
+
if (!this.pendingWithBeforeUpdate.size) {
|
|
304
|
+
this.triggerOnInitialize();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const withBeforeUpdate = this.pendingWithBeforeUpdate;
|
|
308
|
+
this.pendingWithBeforeUpdate = /* @__PURE__ */ new Set();
|
|
309
|
+
for (const state of withBeforeUpdate) {
|
|
310
|
+
const listeners = this.getEventListeners(state, { type: "beforeUpdate" });
|
|
311
|
+
if (listeners === void 0) {
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
switch (state.type) {
|
|
315
|
+
case "field":
|
|
316
|
+
for (const listener of listeners) {
|
|
317
|
+
listener(state.getAccessor());
|
|
318
|
+
}
|
|
319
|
+
break;
|
|
320
|
+
case "entityRealm":
|
|
321
|
+
case "entityList":
|
|
322
|
+
for (const listener of listeners) {
|
|
323
|
+
state.getAccessor().batchUpdates(listener);
|
|
324
|
+
}
|
|
325
|
+
break;
|
|
326
|
+
default:
|
|
327
|
+
return assertNever.assertNever();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
this.triggerOnInitialize();
|
|
331
|
+
}
|
|
332
|
+
throw new BindingError.BindingError(
|
|
333
|
+
`Maximum stabilization limit of updates caused by 'beforeUpdate' exceeded. This likely means there is an infinite feedback loop in your code.`
|
|
334
|
+
);
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
triggerOnInitialize() {
|
|
338
|
+
this.syncTransaction(() => {
|
|
339
|
+
for (const state of this.newlyInitializedWithListeners) {
|
|
340
|
+
const listeners = state.type === "field" ? this.getEventDispatchers(state, { type: "initialize" }, [state.getAccessor, this.batchUpdatesOptions]) : state.type === "entityRealm" ? this.getEventDispatchers(state, { type: "initialize" }, [state.getAccessor, this.batchUpdatesOptions]) : this.getEventDispatchers(state, { type: "initialize" }, [state.getAccessor, this.batchUpdatesOptions]);
|
|
341
|
+
if (listeners) {
|
|
342
|
+
for (const listener of listeners) {
|
|
343
|
+
listener();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (state.type === "entityRealm") {
|
|
347
|
+
state.entity.hasIdSetInStone = true;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
this.newlyInitializedWithListeners.clear();
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
async triggerOnPersistError(options) {
|
|
354
|
+
await this.asyncTransaction(async () => {
|
|
355
|
+
const handlerPromises = [];
|
|
356
|
+
for (const [, subTreeState] of StateIterator.StateIterator.eachRootState(this.treeStore)) {
|
|
357
|
+
for (const iNode of StateIterator.StateIterator.depthFirstINodes(subTreeState)) {
|
|
358
|
+
const dispatchers = iNode.type === "entityRealm" ? this.getEventDispatchers(iNode, { type: "persistError" }, [iNode.getAccessor, options]) : this.getEventDispatchers(iNode, { type: "persistError" }, [iNode.getAccessor, options]);
|
|
359
|
+
if (dispatchers === void 0) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
for (const listener of dispatchers ?? []) {
|
|
363
|
+
try {
|
|
364
|
+
const result = listener();
|
|
365
|
+
if (result instanceof Promise) {
|
|
366
|
+
handlerPromises.push(result);
|
|
367
|
+
} else {
|
|
368
|
+
handlerPromises.push(Promise.resolve(result));
|
|
369
|
+
}
|
|
370
|
+
} catch (e) {
|
|
371
|
+
handlerPromises.push(Promise.reject(e));
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const handlerResults = await Promise.allSettled(handlerPromises);
|
|
377
|
+
this.handleRejections("persistError", handlerResults);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
async triggerOnBeforePersist() {
|
|
381
|
+
return this.triggerAsyncMutatingEvent("beforePersist", this.asyncBatchUpdatesOptions);
|
|
382
|
+
}
|
|
383
|
+
async triggerOnPersistSuccess(options) {
|
|
384
|
+
return this.triggerAsyncMutatingEvent("persistSuccess", options);
|
|
385
|
+
}
|
|
386
|
+
getEventListeners(state, event) {
|
|
387
|
+
if (!state.eventListeners) {
|
|
388
|
+
return void 0;
|
|
389
|
+
}
|
|
390
|
+
return state.eventListeners.get(event);
|
|
391
|
+
}
|
|
392
|
+
getEventDispatchers(state, event, listenerArgs) {
|
|
393
|
+
const eventListeners = this.getEventListeners(state, event);
|
|
394
|
+
if (eventListeners === void 0) {
|
|
395
|
+
return void 0;
|
|
396
|
+
}
|
|
397
|
+
return Array.from(eventListeners.values(), (listener) => {
|
|
398
|
+
return () => listener(...listenerArgs);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
handleRejections(handler, promises) {
|
|
402
|
+
const rejections = promises.filter((it) => it.status === "rejected");
|
|
403
|
+
if (rejections.length === 0) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
rejections.forEach((it) => console.error(it.reason));
|
|
407
|
+
}
|
|
408
|
+
validateWithoutChanges(initialCount, eventType) {
|
|
409
|
+
this.dirtinessTracker.getTotalTouchCount();
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
__publicField(EventManager, "NO_CHANGES_DIFFERENCE", 0);
|
|
413
|
+
exports.EventManager = EventManager;
|
|
414
|
+
//# sourceMappingURL=EventManager.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventManager.cjs","sources":["../../../src/core/EventManager.ts"],"sourcesContent":["import type {\n\tAsyncBatchUpdatesOptions,\n\tBatchUpdatesOptions,\n\tEntityAccessor,\n\tEntityListAccessor,\n\tFieldAccessor,\n\tPersistErrorOptions,\n\tPersistSuccessOptions,\n} from '../accessors'\nimport type { SuccessfulPersistResult } from '../accessorTree'\nimport { BindingError } from '../BindingError'\nimport type { PlaceholderName } from '../treeParameters'\nimport { assertNever } from '../utils'\nimport type { Config } from './Config'\nimport type { DirtinessTracker } from './DirtinessTracker'\nimport {\n\tEntityListState,\n\tEntityRealmState,\n\tFieldState,\n\tgetEntityMarker,\n\tRootStateNode,\n\tStateINode,\n\tStateIterator,\n\tStateNode,\n} from './state'\nimport type { TreeStore } from './TreeStore'\nimport type { UpdateMetadata } from './UpdateMetadata'\nimport type { EventListenersStore } from '../treeParameters'\n\nexport class EventManager {\n\tpublic static readonly NO_CHANGES_DIFFERENCE = 0\n\n\tprivate transactionDepth = 0\n\tprivate isFrozenWhileUpdating = false\n\n\t// This should ideally not exists as it should be synonymous to `this.ongoingPersistOperation !== undefined`\n\t// but it makes persist-related promise juggling significantly more straightforward.\n\tprivate isMutating: boolean = false\n\tprivate ongoingPersistOperation: Promise<SuccessfulPersistResult> | undefined = undefined\n\n\tprivate previousMetadata: UpdateMetadata | undefined = undefined\n\n\tprivate newlyInitializedWithListeners: Set<EntityListState | EntityRealmState | FieldState> = new Set()\n\tprivate pendingWithBeforeUpdate: Set<StateNode> = new Set()\n\tprivate rootsWithPendingUpdates: Set<RootStateNode> = new Set()\n\n\tpublic constructor(\n\t\tprivate readonly asyncBatchUpdatesOptions: AsyncBatchUpdatesOptions,\n\t\tprivate readonly batchUpdatesOptions: BatchUpdatesOptions,\n\t\tprivate readonly config: Config,\n\t\tprivate readonly dirtinessTracker: DirtinessTracker,\n\t\tprivate readonly onUpdate: (metadata: UpdateMetadata) => void,\n\t\tprivate readonly treeStore: TreeStore,\n\t\tprivate readonly batchedUpdates: (callback: () => any) => void,\n\t) {}\n\n\tpublic async persistOperation(operation: () => Promise<SuccessfulPersistResult>): Promise<SuccessfulPersistResult> {\n\t\tif (this.transactionDepth > 0) {\n\t\t\tthrow new BindingError(`Cannot trigger a persist whilst batching updates!`)\n\t\t}\n\t\tconst ongoingOperation = this.ongoingPersistOperation\n\t\tif (ongoingOperation !== undefined) {\n\t\t\treturn await ongoingOperation\n\t\t}\n\t\treturn await (this.ongoingPersistOperation = new Promise<SuccessfulPersistResult>(async (resolve, reject) => {\n\t\t\tthis.isMutating = true\n\t\t\tthis.flushUpdates() // Let the world know that we're mutating\n\n\t\t\ttry {\n\t\t\t\tresolve(await this.asyncOperation(operation))\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error('PersistError', e)\n\t\t\t\treject(e)\n\t\t\t} finally {\n\t\t\t\tthis.ongoingPersistOperation = undefined\n\t\t\t\tthis.isMutating = false\n\t\t\t\tthis.flushUpdates()\n\t\t\t}\n\t\t}))\n\t}\n\n\tpublic syncTransaction<T>(transaction: () => T) {\n\t\ttry {\n\t\t\tthis.transactionDepth++\n\t\t\treturn transaction()\n\t\t} finally {\n\t\t\tthis.transactionDepth--\n\t\t}\n\t}\n\tpublic syncOperation<T>(operation: () => T) {\n\t\tconst result = this.syncTransaction(operation)\n\t\tthis.flushUpdates()\n\t\treturn result\n\t}\n\n\tpublic async asyncTransaction<T>(transaction: () => Promise<T>): Promise<T> {\n\t\ttry {\n\t\t\tthis.transactionDepth++\n\t\t\treturn await transaction()\n\t\t} finally {\n\t\t\tthis.transactionDepth--\n\t\t}\n\t}\n\tpublic async asyncOperation<T>(operation: () => Promise<T>): Promise<T> {\n\t\tconst result = await this.asyncTransaction(operation)\n\t\tthis.flushUpdates()\n\t\treturn result\n\t}\n\n\tprivate flushUpdates() {\n\t\tif (this.transactionDepth > 0) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.isFrozenWhileUpdating) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Trying to perform an update while the whole accessor tree is already updating. This is most likely caused ` +\n\t\t\t\t\t`by updating the accessor tree while rendering or from within the 'update' event handler, which is a no-op. ` +\n\t\t\t\t\t`If you wish to mutate the tree in reaction to other changes, use the 'beforeUpdate' event.`,\n\t\t\t)\n\t\t}\n\n\t\tconst newMetadata = this.getNewUpdateMetadata()\n\n\t\tif (!this.shouldFlushUpdates(newMetadata)) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.batchedUpdates(() => {\n\t\t\tthis.isFrozenWhileUpdating = true\n\t\t\tthis.triggerBeforeFlushEvents()\n\t\t\tthis.onUpdate(newMetadata)\n\t\t\tthis.flushPendingAccessorUpdates(Array.from(this.rootsWithPendingUpdates))\n\n\t\t\tthis.rootsWithPendingUpdates.clear()\n\t\t\tthis.isFrozenWhileUpdating = false\n\t\t\tthis.previousMetadata = newMetadata\n\t\t})\n\t}\n\n\tprivate getNewUpdateMetadata(): UpdateMetadata {\n\t\treturn {\n\t\t\tisMutating: this.isMutating,\n\t\t}\n\t}\n\n\tprivate shouldFlushUpdates(newMetadata: UpdateMetadata): boolean {\n\t\tif (this.transactionDepth > 0) {\n\t\t\treturn false\n\t\t}\n\t\tif (this.previousMetadata === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tif (this.rootsWithPendingUpdates.size) {\n\t\t\treturn true\n\t\t}\n\t\tfor (const key in newMetadata) {\n\t\t\tconst fromPrevious = this.previousMetadata[key as keyof UpdateMetadata]\n\t\t\tconst fromNew = newMetadata[key as keyof UpdateMetadata]\n\n\t\t\tif (!Object.is(fromPrevious, fromNew)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\n\tpublic registerNewlyInitialized(newlyInitialized: StateNode) {\n\t\tconst initializeListeners = this.getEventListeners(newlyInitialized, { type: 'initialize' })\n\n\t\tif (initializeListeners === undefined) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.newlyInitializedWithListeners.add(newlyInitialized)\n\n\t\tif (this.transactionDepth === 0) {\n\t\t\tthis.triggerOnInitialize()\n\t\t}\n\t}\n\n\tpublic registerUpdatedConnection(parentState: EntityRealmState, placeholderName: PlaceholderName) {\n\t\tif (parentState.fieldsWithPendingConnectionUpdates === undefined) {\n\t\t\tparentState.fieldsWithPendingConnectionUpdates = new Set()\n\t\t}\n\n\t\tconst marker = getEntityMarker(parentState)\n\t\tplaceholders: for (const [fieldName, placeholdersByField] of marker.fields.placeholders) {\n\t\t\tif (typeof placeholdersByField === 'string') {\n\t\t\t\tif (placeholdersByField === placeholderName) {\n\t\t\t\t\tparentState.fieldsWithPendingConnectionUpdates.add(fieldName)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const placeholderByFieldName of placeholdersByField) {\n\t\t\t\t\tif (placeholderByFieldName === placeholderName) {\n\t\t\t\t\t\tparentState.fieldsWithPendingConnectionUpdates.add(fieldName)\n\t\t\t\t\t\tcontinue placeholders\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic registerJustUpdated(justUpdated: StateNode, changesDelta: number) {\n\t\tconst beforeUpdateListeners = this.getEventListeners(justUpdated, { type: 'beforeUpdate' })\n\t\tif (beforeUpdateListeners !== undefined) {\n\t\t\tthis.pendingWithBeforeUpdate.add(justUpdated)\n\t\t}\n\t\tjustUpdated.accessor = undefined\n\n\t\tswitch (justUpdated.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList': {\n\t\t\t\tjustUpdated.unpersistedChangesCount += changesDelta\n\n\t\t\t\tif (import.meta.env.DEV) {\n\t\t\t\t\tif (justUpdated.unpersistedChangesCount < 0) {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`We have *JUST* reached a completely invalid state. From now on, anything can (and likely will) ` +\n\t\t\t\t\t\t\t\t`go wrong. This is definitely a bug. Please try to report whatever led to this situation.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst parent = justUpdated.blueprint.parent\n\n\t\t\t\tif (parent === undefined) {\n\t\t\t\t\tthis.rootsWithPendingUpdates.add(justUpdated)\n\n\t\t\t\t\tif (!(justUpdated.blueprint.type === 'subTree' && justUpdated.blueprint.marker.parameters.isCreating && justUpdated.blueprint.marker.parameters.isUnpersisted)) {\n\t\t\t\t\t\tthis.dirtinessTracker.increaseBy(changesDelta)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!parent.childrenWithPendingUpdates) {\n\t\t\t\t\t\tparent.childrenWithPendingUpdates = new Set()\n\t\t\t\t\t}\n\t\t\t\t\tparent.childrenWithPendingUpdates.add(justUpdated as any)\n\t\t\t\t\tthis.registerJustUpdated(parent, changesDelta)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase 'field': {\n\t\t\t\tconst parent = justUpdated.parent\n\t\t\t\tif (!parent.childrenWithPendingUpdates) {\n\t\t\t\t\tparent.childrenWithPendingUpdates = new Set()\n\t\t\t\t}\n\t\t\t\tparent.childrenWithPendingUpdates.add(justUpdated as any)\n\t\t\t\tthis.registerJustUpdated(justUpdated.parent, changesDelta)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate flushPendingAccessorUpdates(rootStates: Array<StateINode>) {\n\t\t// It is *CRUCIAL* that this is a BFS so that we update the components in top-down order.\n\t\tconst agenda: StateNode[] = rootStates\n\n\t\tfor (const state of agenda) {\n\t\t\t// yes, the calls are same, but this way we can avoid type casting\n\t\t\tconst updateListeners =\n\t\t\t\tstate.type === 'field'\n\t\t\t\t\t? this.getEventDispatchers(state, { type: 'update' }, [state.getAccessor()])\n\t\t\t\t\t: state.type === 'entityRealm'\n\t\t\t\t\t? this.getEventDispatchers(state, { type: 'update' }, [state.getAccessor()])\n\t\t\t\t\t: this.getEventDispatchers(state, { type: 'update' }, [state.getAccessor()])\n\n\t\t\tif (updateListeners !== undefined) {\n\t\t\t\tfor (const handler of updateListeners) {\n\t\t\t\t\t// TS can't quite handle the polymorphism here but this is fine.\n\t\t\t\t\thandler()\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (state.type === 'entityRealm' && state.fieldsWithPendingConnectionUpdates) {\n\t\t\t\tfor (const updatedField of state.fieldsWithPendingConnectionUpdates) {\n\t\t\t\t\tconst listeners = this.getEventListeners(state, { type: 'connectionUpdate', key: updatedField })\n\t\t\t\t\tif (!listeners) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\tlistener(state.getAccessor())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (state.type) {\n\t\t\t\tcase 'entityRealm':\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tif (state.childrenWithPendingUpdates !== undefined) {\n\t\t\t\t\t\tfor (const childState of state.childrenWithPendingUpdates) {\n\t\t\t\t\t\t\tagenda.push(childState)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.childrenWithPendingUpdates.clear()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'field':\n\t\t\t\t\t// Do nothing\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(state)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async triggerAsyncMutatingEvent(eventType: 'beforePersist', options: AsyncBatchUpdatesOptions): Promise<void>\n\tprivate async triggerAsyncMutatingEvent(eventType: 'persistSuccess', options: PersistSuccessOptions): Promise<void>\n\tprivate async triggerAsyncMutatingEvent(\n\t\teventType: 'beforePersist' | 'persistSuccess',\n\t\toptions: AsyncBatchUpdatesOptions | PersistSuccessOptions,\n\t): Promise<void> {\n\t\tawait this.asyncTransaction(async () => {\n\t\t\t// TODO if an entity from here (or its parent) gets deleted, we need to remove stale handlers from here.\n\t\t\tconst callbackQueue: Array<\n\t\t\t\t[\n\t\t\t\t\t// The typings could be nicer but TS…\n\t\t\t\t\tStateINode,\n\t\t\t\t\t(\n\t\t\t\t\t\t| EntityAccessor.EntityEventListenerMap[typeof eventType]\n\t\t\t\t\t\t| EntityListAccessor.EntityListEventListenerMap[typeof eventType]\n\t\t\t\t\t),\n\t\t\t\t]\n\t\t\t> = []\n\n\t\t\tfor (const [, subTreeState] of StateIterator.eachRootState(this.treeStore)) {\n\t\t\t\tfor (const iNode of StateIterator.depthFirstINodes(subTreeState)) {\n\t\t\t\t\tconst listeners = this.getEventListeners(iNode, { type: eventType }) ?? []\n\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\tcallbackQueue.push([iNode, listener])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (\n\t\t\t\tlet waterfallDepth = 0;\n\t\t\t\twaterfallDepth < this.config.getValue(`${eventType}SettleLimit` as const);\n\t\t\t\twaterfallDepth++\n\t\t\t) {\n\t\t\t\tconst promiseReturns: Array<\n\t\t\t\t\tPromise<\n\t\t\t\t\t\t| void\n\t\t\t\t\t\t| EntityAccessor.EntityEventListenerMap[typeof eventType]\n\t\t\t\t\t\t| EntityListAccessor.EntityListEventListenerMap[typeof eventType]\n\t\t\t\t\t>\n\t\t\t\t> = []\n\t\t\t\tconst correspondingStates: Array<StateINode> = []\n\n\t\t\t\tif (callbackQueue.length === 0) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tfor (const [state, callback] of callbackQueue) {\n\t\t\t\t\tcorrespondingStates.push(state)\n\t\t\t\t\tconst changesCountBefore = this.dirtinessTracker.getTotalTouchCount()\n\t\t\t\t\tlet validateChanges = false\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = callback(state.getAccessor as any, options as any) // TS can't quite handle this but this is sound.\n\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\tvalidateChanges = true\n\t\t\t\t\t\t\tpromiseReturns.push(result)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpromiseReturns.push(Promise.resolve(result))\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tpromiseReturns.push(Promise.reject(e))\n\t\t\t\t\t}\n\t\t\t\t\tif (validateChanges) {\n\t\t\t\t\t\tthis.validateWithoutChanges(changesCountBefore, eventType)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// TODO timeout\n\n\t\t\t\tconst changesCountBefore = this.dirtinessTracker.getTotalTouchCount()\n\t\t\t\tconst newCallbacks = await Promise.allSettled(promiseReturns)\n\t\t\t\tthis.validateWithoutChanges(changesCountBefore, eventType)\n\n\t\t\t\tcallbackQueue.length = 0 // Empties the queue\n\n\t\t\t\t// TODO we're drifting away from the original depth-first order. Let's see if that's ever even an issue.\n\t\t\t\tfor (const newlyInitialized of this.newlyInitializedWithListeners) {\n\t\t\t\t\tif (newlyInitialized.type === 'field') {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst beforePersistHandlers = this.getEventListeners(newlyInitialized, { type: eventType })\n\t\t\t\t\tif (beforePersistHandlers) {\n\t\t\t\t\t\tfor (const listener of beforePersistHandlers) {\n\t\t\t\t\t\t\tcallbackQueue.push([newlyInitialized, listener])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.triggerBeforeFlushEvents()\n\t\t\t\tthis.handleRejections(eventType, newCallbacks)\n\n\t\t\t\tfor (let i = 0; i < newCallbacks.length; i++) {\n\t\t\t\t\tconst result = newCallbacks[i]\n\t\t\t\t\tconst correspondingState = correspondingStates[i]\n\n\t\t\t\t\tif (result.status === 'fulfilled') {\n\t\t\t\t\t\tif (typeof result.value === 'function') {\n\t\t\t\t\t\t\tcallbackQueue.push([correspondingState, result.value])\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise do nothing. This is just a handler that albeit async, doesn't appear to\n\t\t\t\t\t\t// interact with data binding.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (import.meta.env.DEV) {\n\t\t\t\tif (callbackQueue.length) {\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Exceeded the ${eventType} settle limit. Your code likely contains a deadlock. ` +\n\t\t\t\t\t\t\t`If that's not the case, raise the settle limit from DataBindingProvider.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate triggerBeforeFlushEvents() {\n\t\tthis.syncTransaction(() => {\n\t\t\tconst settleLimit = this.config.getValue('beforeUpdateSettleLimit')\n\n\t\t\tfor (let attemptNumber = 0; attemptNumber < settleLimit; attemptNumber++) {\n\t\t\t\tif (!this.pendingWithBeforeUpdate.size) {\n\t\t\t\t\tthis.triggerOnInitialize()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst withBeforeUpdate = this.pendingWithBeforeUpdate\n\t\t\t\tthis.pendingWithBeforeUpdate = new Set()\n\n\t\t\t\tfor (const state of withBeforeUpdate) {\n\t\t\t\t\tconst listeners = this.getEventListeners(state, { type: 'beforeUpdate' })\n\t\t\t\t\tif (listeners === undefined) {\n\t\t\t\t\t\t// This can happen if the listener has unsubscribed since we added it to the set.\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tswitch (state.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\t\t\t(listener as FieldAccessor.BeforeUpdateListener)(state.getAccessor())\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\t\t\tstate.getAccessor().batchUpdates(listener as any)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(state)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.triggerOnInitialize()\n\t\t\t}\n\t\t\tthrow new BindingError(\n\t\t\t\t`Maximum stabilization limit of updates caused by 'beforeUpdate' exceeded. ` +\n\t\t\t\t\t`This likely means there is an infinite feedback loop in your code.`,\n\t\t\t)\n\t\t})\n\t}\n\n\tprivate triggerOnInitialize() {\n\t\tthis.syncTransaction(() => {\n\t\t\tfor (const state of this.newlyInitializedWithListeners) {\n\t\t\t\t// yes, the calls are same, but this way we can avoid type casting\n\t\t\t\tconst listeners =\n\t\t\t\t\tstate.type === 'field'\n\t\t\t\t\t\t? this.getEventDispatchers(state, { type: 'initialize' }, [state.getAccessor, this.batchUpdatesOptions])\n\t\t\t\t\t\t: state.type === 'entityRealm'\n\t\t\t\t\t\t? this.getEventDispatchers(state, { type: 'initialize' }, [state.getAccessor, this.batchUpdatesOptions])\n\t\t\t\t\t\t: this.getEventDispatchers(state, { type: 'initialize' }, [state.getAccessor, this.batchUpdatesOptions])\n\n\t\t\t\tif (listeners) {\n\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\tlistener()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (state.type === 'entityRealm') {\n\t\t\t\t\tstate.entity.hasIdSetInStone = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.newlyInitializedWithListeners.clear()\n\t\t})\n\t}\n\n\tpublic async triggerOnPersistError(options: PersistErrorOptions) {\n\t\tawait this.asyncTransaction(async () => {\n\t\t\tconst handlerPromises: Array<Promise<void>> = []\n\n\t\t\tfor (const [, subTreeState] of StateIterator.eachRootState(this.treeStore)) {\n\t\t\t\tfor (const iNode of StateIterator.depthFirstINodes(subTreeState)) {\n\t\t\t\t\t// yes, the calls are same, but this way we can avoid type casting\n\t\t\t\t\tconst dispatchers =\n\t\t\t\t\t\tiNode.type === 'entityRealm'\n\t\t\t\t\t\t\t? this.getEventDispatchers(iNode, { type: 'persistError' }, [iNode.getAccessor, options])\n\t\t\t\t\t\t\t: this.getEventDispatchers(iNode, { type: 'persistError' }, [iNode.getAccessor, options])\n\t\t\t\t\tif (dispatchers === undefined) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfor (const listener of dispatchers ?? []) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst result = listener()\n\t\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\t\thandlerPromises.push(result)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thandlerPromises.push(Promise.resolve(result))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\thandlerPromises.push(Promise.reject(e))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO timeout\n\t\t\tconst handlerResults = await Promise.allSettled(handlerPromises)\n\t\t\tthis.handleRejections('persistError', handlerResults)\n\t\t})\n\t}\n\n\tpublic async triggerOnBeforePersist() {\n\t\treturn this.triggerAsyncMutatingEvent('beforePersist', this.asyncBatchUpdatesOptions)\n\t}\n\n\tpublic async triggerOnPersistSuccess(options: PersistSuccessOptions) {\n\t\treturn this.triggerAsyncMutatingEvent('persistSuccess', options)\n\t}\n\n\tpublic getEventListeners<\n\t\tState extends StateNode,\n\t\tEventListenerTypes extends\n\t\t\tExclude<State['eventListeners'], undefined> extends EventListenersStore<infer Keys, infer Map> ? [Keys, Map] : never,\n\t\tEventType extends EventListenerTypes[0],\n\t>(state: State, event: { type: EventType; key?: string }): Set<Exclude<EventListenerTypes[1][EventType], undefined>> | undefined {\n\t\tif (!state.eventListeners) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn (state.eventListeners as EventListenersStore<EventType, EventListenerTypes[1]>).get(event) as Set<\n\t\t\tExclude<EventListenerTypes[1][EventType], undefined>\n\t\t>\n\t}\n\n\tpublic getEventDispatchers<\n\t\tState extends StateNode,\n\t\tEventListenerTypes extends\n\t\t\tExclude<State['eventListeners'], undefined> extends EventListenersStore<infer Keys, infer Map> ? [Keys, Map] : never,\n\t\tEventType extends EventListenerTypes[0],\n\t>(\n\t\tstate: State,\n\t\tevent: { type: EventType; key?: string },\n\t\tlistenerArgs: Parameters<Exclude<EventListenerTypes[1][EventType], undefined>>,\n\t): Array<() => ReturnType<Exclude<EventListenerTypes[1][EventType], undefined>>> | undefined {\n\t\tconst eventListeners = this.getEventListeners(state, event)\n\t\tif (eventListeners === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn Array.from(eventListeners.values(), listener => {\n\t\t\treturn () => listener(...listenerArgs)\n\t\t}) as Array<() => ReturnType<Exclude<EventListenerTypes[1][EventType], undefined>>>\n\t}\n\n\tprivate handleRejections(handler: string, promises: PromiseSettledResult<any>[]) {\n\t\tconst rejections = promises.filter((it): it is PromiseRejectedResult => it.status === 'rejected')\n\t\tif (rejections.length === 0) {\n\t\t\treturn\n\t\t}\n\t\trejections.forEach(it => console.error(it.reason))\n\t\tif (import.meta.env.DEV) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`A ${handler} handler returned a promise that rejected. ` +\n\t\t\t\t\t`This is a no-op that will fail silently in production.`,\n\t\t\t)\n\t\t}\n\t}\n\n\n\tprivate validateWithoutChanges(initialCount: number, eventType: string): void {\n\t\tconst changesCountAfter = this.dirtinessTracker.getTotalTouchCount()\n\t\tif (import.meta.env.DEV) {\n\t\t\tif (initialCount !== changesCountAfter) {\n\t\t\t\t// This isn't bulletproof. They could e.g. undo a change and make another one which would\n\t\t\t\t// slip through this detection. But for most cases, it should be good enough and not too expensive.\n\t\t\t\tthrow new BindingError(\n\t\t\t\t\t`A ${eventType} event handler cannot be asynchronous and alter the accessor tree at the same time. ` +\n\t\t\t\t\t`To achieve this, prepare your data asynchronously but only touch the tree from a returned callback.`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["BindingError","getEntityMarker","assertNever","StateIterator","changesCountBefore"],"mappings":";;;;;;;;;;;;AA6BO,MAAM,aAAa;AAAA,EAiBlB,YACW,0BACA,qBACA,QACA,kBACA,UACA,WACA,gBAChB;AAtBM,4CAAmB;AACnB,iDAAwB;AAIxB;AAAA;AAAA,sCAAsB;AACtB;AAEA;AAEA,6EAA0F;AAC1F,uEAA8C;AAC9C,uEAAkD;AAGxC,SAAA,2BAAA;AACA,SAAA,sBAAA;AACA,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,WAAA;AACA,SAAA,YAAA;AACA,SAAA,iBAAA;AAAA,EAC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,WAAW,eAAe;AAC1D,WAAA,iBAAiB,gBAAgB,cAAc;AAAA,IAAA,CACpD;AAAA,EACF;AAAA,EAEA,MAAa,yBAAyB;AACrC,WAAO,KAAK,0BAA0B,iBAAiB,KAAK,wBAAwB;AAAA,EACrF;AAAA,EAEA,MAAa,wBAAwB,SAAgC;AAC7D,WAAA,KAAK,0BAA0B,kBAAkB,OAAO;AAAA,EAChE;AAAA,EAEO,kBAKL,OAAc,OAAiH;AAC5H,QAAA,CAAC,MAAM,gBAAgB;AACnB,aAAA;AAAA,IACR;AACQ,WAAA,MAAM,eAAyE,IAAI,KAAK;AAAA,EAGjG;AAAA,EAEO,oBAMN,OACA,OACA,cAC4F;AAC5F,UAAM,iBAAiB,KAAK,kBAAkB,OAAO,KAAK;AAC1D,QAAI,mBAAmB,QAAW;AAC1B,aAAA;AAAA,IACR;AACA,WAAO,MAAM,KAAK,eAAe,UAAU,CAAY,aAAA;AAC/C,aAAA,MAAM,SAAS,GAAG,YAAY;AAAA,IAAA,CACrC;AAAA,EACF;AAAA,EAEQ,iBAAiB,SAAiB,UAAuC;AAChF,UAAM,aAAa,SAAS,OAAO,CAAC,OAAoC,GAAG,WAAW,UAAU;AAC5F,QAAA,WAAW,WAAW,GAAG;AAC5B;AAAA,IACD;AACA,eAAW,QAAQ,CAAM,OAAA,QAAQ,MAAM,GAAG,MAAM,CAAC;AAAA,EAOlD;AAAA,EAGQ,uBAAuB,cAAsB,WAAyB;AACnD,SAAK,iBAAiB,mBAAmB;AAAA,EAWpE;AACD;AA9iBC,cADY,cACW,yBAAwB;;"}
|
|
@@ -4,13 +4,12 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import * as ReactDOM from "react-dom";
|
|
8
7
|
import { BindingError } from "../BindingError.js";
|
|
9
|
-
import { StateIterator } from "./state/StateIterator.js";
|
|
10
8
|
import { getEntityMarker } from "./state/getEntityMarker.js";
|
|
9
|
+
import { StateIterator } from "./state/StateIterator.js";
|
|
11
10
|
import { assertNever } from "../utils/assertNever.js";
|
|
12
11
|
class EventManager {
|
|
13
|
-
constructor(asyncBatchUpdatesOptions, batchUpdatesOptions, config, dirtinessTracker, onUpdate, treeStore) {
|
|
12
|
+
constructor(asyncBatchUpdatesOptions, batchUpdatesOptions, config, dirtinessTracker, onUpdate, treeStore, batchedUpdates) {
|
|
14
13
|
__publicField(this, "transactionDepth", 0);
|
|
15
14
|
__publicField(this, "isFrozenWhileUpdating", false);
|
|
16
15
|
// This should ideally not exists as it should be synonymous to `this.ongoingPersistOperation !== undefined`
|
|
@@ -27,6 +26,7 @@ class EventManager {
|
|
|
27
26
|
this.dirtinessTracker = dirtinessTracker;
|
|
28
27
|
this.onUpdate = onUpdate;
|
|
29
28
|
this.treeStore = treeStore;
|
|
29
|
+
this.batchedUpdates = batchedUpdates;
|
|
30
30
|
}
|
|
31
31
|
async persistOperation(operation) {
|
|
32
32
|
if (this.transactionDepth > 0) {
|
|
@@ -90,7 +90,7 @@ class EventManager {
|
|
|
90
90
|
if (!this.shouldFlushUpdates(newMetadata)) {
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
this.batchedUpdates(() => {
|
|
94
94
|
this.isFrozenWhileUpdating = true;
|
|
95
95
|
this.triggerBeforeFlushEvents();
|
|
96
96
|
this.onUpdate(newMetadata);
|
|
@@ -168,7 +168,9 @@ class EventManager {
|
|
|
168
168
|
const parent = justUpdated.blueprint.parent;
|
|
169
169
|
if (parent === void 0) {
|
|
170
170
|
this.rootsWithPendingUpdates.add(justUpdated);
|
|
171
|
-
|
|
171
|
+
if (!(justUpdated.blueprint.type === "subTree" && justUpdated.blueprint.marker.parameters.isCreating && justUpdated.blueprint.marker.parameters.isUnpersisted)) {
|
|
172
|
+
this.dirtinessTracker.increaseBy(changesDelta);
|
|
173
|
+
}
|
|
172
174
|
} else {
|
|
173
175
|
if (!parent.childrenWithPendingUpdates) {
|
|
174
176
|
parent.childrenWithPendingUpdates = /* @__PURE__ */ new Set();
|