Skip to content

Usage of toValue, operators and async support #953

Closed

Description

@harttle

toValue is not transparent to filter/tags in current design, causing them

Backgrounds:

toValue() is widely used, and Liquid operator is different from JavaScript. That means we'll still need both toValue() and Drop, and nil, empty need to be a Drop or Symbol as they convey different semantics from other JavaScript primitives, thus

  • operator input need include Drop, or Symbol. The latter approach frees operators from Drop, while adds complexity as:
    • each operator need be aware of all Symbols, knowing how to compare them
    • Liquid output should aware of all Symbols, knowing how to stringify them
  • toValue need not be coupled with operators. Meaning operators work with Drop/Symbols, while filters/tags work with values, unaware of Drop or Symbol.

Proposals:

  1. Keep Drop abstraction for empty, nil, etc. as Drop still need to be supported as a core Liquid concept. And using ·Drop for them is simpler than Symbols.
  2. Keep Comparable interface as it's originally designed for comparing Drops and it works well, but it need to support async
  3. Pass final values to filters/tags instead of possible Drops, meaning will have both evalToken and evallTokenValue:
  • evalToken for foo.bar contains 3, where expression receives Drop or values
  • evalTokenValue for {{ foo.bar | join }}wherejoin` receives values

Activity

  1. changed the title [-]v11: simplify operators around Drop.valueOf (remove Comparable)[/-] [+]Simplify operators around Drop.valueOf (remove Comparable)[/+] on Sep 6, 2026
  2. changed the title [-]Simplify operators around Drop.valueOf (remove Comparable)[/-] [+]Simplify operators around Drop.valueOf[/+] on Sep 20, 2026
  3. changed the title [-]Simplify operators around Drop.valueOf[/-] [+]Usage of toValue, Comparable, operators and async support[/+] on Sep 20, 2026
  4. changed the title [-]Usage of toValue, Comparable, operators and async support[/-] [+]Usage of toValue, operators and async support[/+] on Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions