Should useMeta follow the Stimulus member variable naming convention? #83
-
I'm genuinely excited to put useMeta to work. I use meta tags to do everything from JWT tokens to tenant keys. I do wonder if "we" should change the member variables useMeta creates to follow the convention established by targets and values. That is, if we define: static meta = ["token"]
// ....
// we should access:
this.tokenMeta Not only is this a reasonable expectation based on Since the feature is out only a few hours, perhaps there's a "5 second rule" cool off possible. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Thanks for this excellent and valid suggestion I don't think anyone put it in production so having a breaking change is largely acceptable for me at this point. I was thinking about putting a process where new mixin would be released in some beta version first with potential breaking changes without having to bump the full library to a major version. (other topic any way) Back to the subject, one solution I can think of would be to pass an option useMeta(this) // this.token
useMeta(this, { suffix: true }) // this.tokenMeta
useMeta(this, { suffix: "value" }) // this.tokenValue Does it default to false ? My experience was to use it for some pretty obvious things such as userId, environment, feature flags etc with rather low risk of collusion Also I had another very interesting feedback from someone doing similar things but with data attributes on the body tag. I bring this up because I will probably add this support for params in the body tag and introduce some kind of opt-in option for that. So this is another reason to add some option. |
Beta Was this translation helpful? Give feedback.
Thanks for this excellent and valid suggestion
I don't think anyone put it in production so having a breaking change is largely acceptable for me at this point. I was thinking about putting a process where new mixin would be released in some beta version first with potential breaking changes without having to bump the full library to a major version. (other topic any way)
Back to the subject, one solution I can think of would be to pass an option
Does it default to false ? My experience was to use it for some pretty obvious things such as userId, environment,…