Skip to content

Model static fields stopped resolving in 3.0 #867

@MihaxXx

Description

@MihaxXx

First, thank you for all the work on Fluid and the upcoming 3.0 release!

Background

The Liquid documentation declares nil as the null value, but the Shopify team decided to use null instead because they prefer (they still have nil in some places...) it and Ruby works fine with both: Shopify/dawn#2115 (comment)

Issue

Previously, I've just added a static Null field that references NilValue.Instance to the model to handle this:

public static FluidValue Null => NilValue.Instance;

However, 3.0.0-beta1 doesn't recognize it. Is this an intentional part of the transition from MemberAccessStrategy?

Discussion Point

More broadly, the problem of null values usage in Liquid templates might be worth discussing itself. For Shopify theme compatibility, supporting null as an alias for nil would be valuable.

Is there a recommended approach for handling this in 3.0? Should we:

  1. Register null as a global value in TemplateOptions?
  2. Use a custom member accessor?
  3. Something else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions