Skip to content
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

[bug] casing rules contrary to Web ecosystem naming conventions #72

Open
DerekNonGeneric opened this issue Aug 2, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@DerekNonGeneric
Copy link
Member

According to the Web Platform Design Principles outlined by members of the W3C TAG, our API is at least in violation of guidelines laid out in the section on naming principles.

Use Web consistent names

When choosing a name for feature or API that has exposure in other technology stacks, the preference should be towards the Web ecosystem naming convention rather than other communities.

Casing rule Examples
Methods and properties
(Web IDL attributes, operations, and dictionary keys)
Camel case createAttribute()
compatMode
Classes and mixins
(Web IDL interfaces)
Pascal case NamedNodeMap
NonElementParentNode
Initialisms in APIs All caps, except when the first word in a method or property HTMLCollection
innerHTML
bgColor
Repeated initialisms in APIs Follow the same rule HTMLHRElement
RTCDTMFSender
The abbreviation of "identity" Id, except when the first word in a method or property getElementById()
pointerId
id
Enumeration values Lowercase, dash-delimited "no-referrer-when-downgrade"
Events Lowercase, concatenated canplaythrough
languagechange
HTML elements and attributes Lowercase, concatenated figcaption
maxlength
JSON keys Lowercase, underscore-delimited short_name

Refs: https://w3ctag.github.io/design-principles/#casing-rules




GhFileImporter

Kind: global class

new GhFileImporter(options)

Creates an instance of GhFileImporter.


Situation Casing rule Status
Classes and mixins (Web IDL interfaces) Pascal case
Initialisms in APIs All caps, except when the first word in a method or property



The API's class name and other parts will need to be re-written. The class name should likely be GHFileImporter, and the names of the methods ending in *FromUrl would need to be *FromURL are just a couple of things I was able to catch at a quick glance…

This will be a very disruptive breaking change — in this issue, we are offered a brief glimpse at how the new v3 API will be changing to be designed more like a Web Platform API, so that should be an exciting thing to look forward to for the August release happening later this month.

@DerekNonGeneric DerekNonGeneric added the bug Something isn't working label Aug 2, 2022
@DerekNonGeneric DerekNonGeneric self-assigned this Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant