-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider adding internal slots to taxonomy #1
Comments
I'd be ok with: defaults to "attribute", but can be a "method", and not exported by default. |
I'm not sure I understand the "not exported by default" proposal. Does it mean that:
In other words, would the change be internal to authoring tools? Or would the change affect the definitions contract? I'm fine with 1 although I continue to think that it would be easier to introduce dedicated types for internal slots and methods (but then introducing new types may be more complex than meets the eye?). I'd prefer to avoid 2. as I think the goal of the contract is to keep things straightforward, and having to parse a term to understand whether it is exported or not seems wrong. |
I definitely meant (1); I too have a preference for a dedicated type to avoid overloading the meaning of "attribute" and "method", but I could live with the other approach if introducing new types is found too costly for some reason. (one cost could be the transition of the existing definitions, but arguably the authoring tools could detect the situation and automatically fix it with warnings) |
another reason for a dedicate type: there are clear rules regarding acceptable values and case-sensitivity for attributes and methods, there are no such rules (that I know of) with regard to internal slots. |
@tidoust wrote:
I.e., I mean the tool MUST NOT add
I was thinking tools "do nothing": i.e., leaving it to the spec editor to explicitly add
No. Extraction tools shouldn't need to do anything here. @dontcallmedom wrote:
This is true. Almost anything seems to go with internal slots... we have /\[\[(\w+(?: +\w+)*)\]\](\([^)]*\)(\.[^)]*\))?)*$/; Fun example:
More examples, just type |
Then I'm still lost :) Let me try to reformulate. The current rule is: "Either With the current rule, definitions with type If you want "not exported by default", the rule needs to change somehow. The rule may be changed for all The rule may also be changed for Or the rule does not change, but then to keep internal slots private by default, authoring tools would need to add a |
Ah, ok. ReSpec doesn't add "noexport" itself, because we assume everything that is not WebIDL is private by default: We leave it for the spec editor to add "data-noexport" explicitly, but only to signal to other spec editors that this is private by design.
Right. That's not how ReSpec works (exports not added). Currently working on this patch:
I was thinking only for internal slots. Regular methods and attributes would be exported by default.
I agree. We should avoid that.
I'd be ok with adding what you suggest above (explicit no-export if export is missing) to: https://github.com/w3c/respec/pull/3646 |
another potential reason for a dedicated type: not all internal slots can be linked to an IDL name; e.g. there are internal slots for the "relevant global object" (Audio Output Devices), or applied to un-IDL-named union of interfaces ( ("potential" as maybe this shouldn't be done that way?) The ̀[[Name]]` notation comes from the EcmaScript Record field names convention, so presumably that type could be re-used to mark up definitions there. |
I started the convention of marking up internal slots as attributes and/or methods (but with a
Those are potentially fine; nothing actually requires the (And for the not-explicitly-defined union of track interfaces, that should just be |
I don't dispute that internal slots may behave like attributes and methods in many sort of ways, but there are also many ways they don't (naming conventions, explicit typing, systematic association to an IDL interface to name a few), and keeping them into a single type feels wrong. While it's fine to use the same micro-syntax for internal slots as for methods/attributes when authoring specs, I think losing the distinction in the type system pushes a lot of the potential adaption to these differences to data consumers. i.e. instead of
you end up with
|
I mean, that seems fine? Consumers of the raw data are, like, a half-dozen people max. And you've just correctly provided the way to distinguish between them. I'm not sure what additional benefit I'd receive in Bikeshed from being able to use one test vs the other. Versus if we push the distinction into the type system, then every spec author needs to know about the distinction and correctly categorize their stuff. It seems like a pretty strong priority-of-constituencies argument to categorize them as attributes/methods, then. |
I hadn't considered the cost on spec authors (I was looking at this under the ReSpec perspective which sets that type automatically); I agree this is an important consideration, and that it would need a more convincing case than the one I've brought so far. |
See ongoing discussions in https://github.com/w3c/respec/issues/3644 - it may be that
attribute
andmethod
are sufficient, but then maybe they shouldn't be exported by default?The text was updated successfully, but these errors were encountered: