Skip to content

options and apis to cammelcase #109

@harttle

Description

@harttle

One of the main purpose of this repo is provide a shopify-compliant template engine in JavaScript. Now I find something wrong with the code base: there're more and more shopify-like or ruby-like code and they look weird. So here's the plan:

  1. Rename snake_cased liquidjs options (such as strict_filters) to camelCase (like strictFilters), which is widely used in JavaScript world and so in this repo.
  2. Rename API/Interfaces into camelCase, such as liquid_method_missing should be liquidMethodMissing
  3. JavaScript toString is used rather than liquid-like inspect for object output. Differences between toString and to_s are documented here
  4. Behavior for math filters will stick to JavaScript Number, i.e. {{0.3 | minus: 0.1}} will output "0.19999999"

That does not mean liquidjs is no longer compatible to shopify/liquid, but it will do more to embrace the JavaScript way. Despite the APIs and options will be different, the following behaviors/rules will always remain the same:

  1. the template syntax will be fully compatible
  2. the tags behaviors will be fully compatible
  3. the filters/outputs will be almost compatible, I'll do my best to resolve or claim the language differences like undefined, null, NaN.

From now on snake_case will be deprecated, and will be remove in the next major version, which is 8.0.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions