Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Support arbitrary expressions on "requires" property #513

Closed
davidtheclark opened this issue Oct 4, 2016 · 2 comments
Closed

Support arbitrary expressions on "requires" property #513

davidtheclark opened this issue Oct 4, 2016 · 2 comments

Comments

@davidtheclark
Copy link
Contributor

I'm thinking about:

So I'm wondering if it might be worthwhile to reconsider the current format of the "requires" value, changing it to something that can be more consistent and robust.

How about this: The value of "requires" is always an array of objects, each object with these properties:

  • property (required): The required property name.
  • operator (optional): An operator pertaining to the property (e.g. "!", "<=").
  • values (optional): An array of objects representing satisfactory values for the specified property, each object with these properties:
    • value (required): The satisfactory value.
    • operator (optional): An operator pertaining to the value. For example, maybe you in the future we'll want to specify that some property must have any value other than 0, or any value greater than 0.

The main principle here is that an object is going to be more flexible and future-proof than a string.

That's my idea.

@davidtheclark
Copy link
Contributor Author

I see one up-thumb ... Anybody else object or agree to this? I can work on a PR if we think it's worth an experiment.

@lucaswoj lucaswoj changed the title Should we re-format the "requires" value? Support arbitrary expressions on "requires" property Dec 22, 2016
@lucaswoj
Copy link

lucaswoj commented Feb 1, 2017

This issue was moved to mapbox/mapbox-gl-js#4130

@lucaswoj lucaswoj closed this as completed Feb 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants