A component based functional template language

add global / local tags #10

Open t.ewert.foo
Open opened by t.ewert.foo

There needs to be a notion of global and a local tags. Global tags can't be used to conditionally render local tags.

Global tags currently are:

  • Store
  • StoreItem
  • All Custom Tags

All other tags are local.

The Problem this solves is the following: If I change a store item inside the cms, any page could change and require additional fields. To validate if all fields are still valid after a store change, every page needs to be validated.

If we assume, that a validation takes 8ms and we have 1000 pages, this would take 1 Minute to validate, which is not acceptable, as we need to validate on publish. The other issue is that I would be able to invalidate pages, which I might not have the permission to change.

If we just disallow global tags data from being used inside conditions, all issues should be preventable. So tags should be marked as global or local. When a global tag is used inside a condition, the if expression (including the bodies) should also be marked as global. If a tag is defined inside a global expression, we throw an error on the condition location.

Open questions:

  • Would it be fine to allow global tags inside global expressions?
Sign up or Sign in to add to the discussion.