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

Document non-code casing conventions #71204

Open
rudolf opened this issue Jul 9, 2020 · 1 comment
Open

Document non-code casing conventions #71204

rudolf opened this issue Jul 9, 2020 · 1 comment
Labels
chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@rudolf
Copy link
Contributor

rudolf commented Jul 9, 2020

There's currently a myriad of casing conventions without a single place that documents all of them. This makes it hard for plugins to maintain consistency. We should document these conventions and make sure that examples in documentation, example plugins and test plugins follow these conventions to avoid confusion.

Frontend app URL's / appRoute => snake_case

We should document that plugins should follow the convention of using snake_case for their app URL's.

Frontend appId => snake_case?

There doesn't seem to be a strong convention in existing code, but given that appRoute defaults to /app/${appId} it should probably be snake_case unless we change the default to something like /app/${toSnakeCase(appId)}.

Config keys => camelCase

New Config keys should be in camelCase until we refactor all config keys to snake_case in 8.0.0 #7444 (comment)

PluginId => camelCase

We have a runtime warning, but not sure if we have documentation

log.warn(`Expect plugin "id" in camelCase, but found: ${manifest.id}`);

API URL's and fields => snake_case

Already documented https://github.com/elastic/kibana/blob/master/STYLEGUIDE.md#api-endpoints

Saved Object type names => snake_case

Most types use kebab-case but since the type name forms part of the saved objects API URLs (https://www.elastic.co/guide/en/kibana/master/saved-objects-api-get.html) a better convention would be to use snake_case. Note: Changing saved object type names is not supported at the moment and would be a breaking API change, so we should not change existing types.

@rudolf rudolf added chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Jul 9, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

2 participants