All non-script changes from scripting branch
The major changes are
- [Breaking] No two components in a constraint system can have the same name.
- [Breaking] The value of a HotDrink variable is updated at once, and does not need to wait for the current promise to be settled.
- Allow variable references to accept
null
value.- Clarification: Only the flow types has been changed.
- This might not be that breaking after all.
- Add simpler editing of components and variables with the
edit
method.- For example
cs.edit.comp.var
would return value of the hotdrink variablevar
in componentcomp
for the constraint system found in thecs
variable. - For example
cs.edit.comp.var = 123
would set the value of the hotdrink variablevar
to123
in the componentcomp
for the constraint system found in thecs
variable. - Nested components are not supported
- Use the suffix
_self
to get either component or the variable reference.-
cs.edit.comp_self
would get you the component -
cs.edit.comp.var_self
would get you the variable reference
-
- Editing is most useful when debugging a constraint system, e.g., in the console of a web browser
- For example
- Allow
Subscription
s to haveadditionalSubscriptions
- This makes it possible to attach multiple
Subscription
s to the mainSubscription
to simultaneously unsubscribe from.
- This makes it possible to attach multiple
- Add
variableListener
andretainingVariableListener
to simplify listening to changes in variables.- Note that it will not listen to changes in variable references.
- Add generic binders for HTML specific view:
bidirectionalElementListener
andelementAttributeBinder
- Allow
ConstraintSystem
,Component
,Constraint
,Method
,VariableReference
, andVariable
to be serialized.- ConstraintSystem to json can be done with
constraintSystemToJson(system)
- json to cs can be done with
constraintSystemFromJson(json)
- ConstraintSystem to json can be done with
And some minor changes
- Generally improve the types.
- Flow linting now throws errors instead of a warning, see
.flowconfig
for the active linting rules. - Add back missing
init
make step required for the first installation. - Fix the whap tutorial.
- Update all dependencies to their latest version.
- All files are now
//@flow strict
which means linting is stricter. - All
==
have been replaced with===
. - Lower delay in tests to make them run quicker.
-
owner
andsystem
inComponent
can no longer beundefined
, but stillnull
. - Expose owner getter in
Component
. - Change the fresh names generators to not use
#
but rather_
to make automated names work with editing. - Add
hasVariableReferenceName
toComponent
. - Add
componentByName
toConstraintSystem
. - Add
allComponents
toConstraintSystem
. - Expose
optional
getter inConstraint
. - Expose
owner
andowningReference
getters inVariableReference
. - Add
qualifiedName
function toVariableReference
. - Disable logging when testing.
- Add
pExactStrings
andpTryUnnamed
to parsing. - Throw exception instead of asserting resolving constraint system graph. This makes it possible to undo whatever made the system fail in a try-catch block.
Edited by Karl Henrik Elg Barlinn