-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 and enforce camelCase plugin id format #52190
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
+1 to camelCase! |
If we choose to go with camel, should the plugin's folder follows this rule too? |
@pgayvallet we cannot. We've already got a filename convention https://github.com/elastic/kibana/blob/master/STYLEGUIDE.md#filenames |
+1 to camelCase then
|
+1 to camelCase as well |
Going with camelCase. Need documentation and runtime validation of camelCase. |
As we decided to go with #46705 the proposed change will create a mismatch between pluginId // kibana.json
"configPath": ["foo_bar"],
"id": "fooBar"
// kibana.yml
foo_bar.baz: 42 If // kibana.json
"id": "fooBar"
// kibana.yml
fooBar.baz: 42 Otherwise it will be // kibana.json
"id": "fooBar"
// kibana.yml
foo_bar.baz: 42 |
As we want to go away from camelCase in configuration in #46705, I'm afraid letting |
I think we should have good defaults here so that plugins don't have to specify I don't think the risks of auto-converting the plugin ID to get the the default configPath are very high, but should definitely be documented well. I don't think we should auto-convert the
As an aside, it'd be nice if xpack plugins didn't have to specify a configPath manually, but that's a separate issue. |
The legacy plugin system uses a convention that plugin
id
should be insnake_case
. All public API provided viahapi
plugin system followed this conventionIn legacy platform plugin public contract looks like:
Although on the client side plugins can register an angular directive or export API under any name, usually in camelCase.
In New platform, we should formalize the requirement for
id
format, because it's the part of the plugin public contract.Dependent plugins use it:
Since
id
became a first-class citizen in the app codes, shouldn't we review our requirement and enforce the camelCase format for it?We can add runtime check in discovery to enforce this rule.
The text was updated successfully, but these errors were encountered: