Skip to content

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 variable var in component comp for the constraint system found in the cs variable.
    • For example cs.edit.comp.var = 123 would set the value of the hotdrink variable var to 123 in the component comp for the constraint system found in the cs 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
  • Allow Subscriptions to have additionalSubscriptions
    • This makes it possible to attach multiple Subscriptions to the main Subscription to simultaneously unsubscribe from.
  • Add variableListener and retainingVariableListener 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 and elementAttributeBinder
  • Allow ConstraintSystem, Component, Constraint, Method, VariableReference, and Variable to be serialized.
    • ConstraintSystem to json can be done with constraintSystemToJson(system)
    • json to cs can be done with constraintSystemFromJson(json)

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 and system in Component can no longer be undefined, but still null.
  • Expose owner getter in Component.
  • Change the fresh names generators to not use # but rather _ to make automated names work with editing.
  • Add hasVariableReferenceName to Component.
  • Add componentByName to ConstraintSystem.
  • Add allComponents to ConstraintSystem.
  • Expose optional getter in Constraint.
  • Expose owner and owningReference getters in VariableReference.
  • Add qualifiedName function to VariableReference.
  • Disable logging when testing.
  • Add pExactStrings and pTryUnnamed 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

Merge request reports

Loading