docs/extend/development-best-practices.md
Consider these best practices, whether developing code directly to the {{kib}} repo or building your own plugins. They are intended to support our {{kib}} development principles.
Are you planning with scalability in mind?
Consider data with many fields
Consider data with high cardinality fields
Consider large data sets, that span a long time range
Are you loading a minimal amount of JS code in the browser?
Do you make lots of requests to the server?
Did you know {{kib}} makes a public statement about our commitment to creating an accessible product for people with disabilities? We do! It’s very important all of our apps are accessible.
{{kib}} is translated into other languages. Use our i18n utilities to ensure your public facing strings will be translated to ensure all {{kib}} apps are localized.
SavedObjectClient for reading and writing Saved Objects.READMEs to all your plugins and services.Over-refactoring can be a problem in it’s own right, but it’s still important to be aware of the existing services that are out there and use them when it makes sense. We have service oriented teams dedicated to providing our solution developers the tools needed to iterate faster. They take care of the nitty gritty so you can focus on creative solutions to your particular problem sphere. Some examples of common services you should consider:
esSearchStrategy to make raw queries to ES that will support async searching and partial results, as well as injecting the right advanced settings like whether to include frozen indices or not.Stateless helper utilities
state syncing and
state container utilities provided by
kibana_utils if you want to sync your application state to the URL?
Re-using these services will help create a consistent experience across {{kib}} from every solution.
Eventually we want to guarantee to our plugin developers that their plugins will not break from minor to minor.
Any time you create or change a public API, keep this in mind, and consider potential backward compatibility issues. While we have a formal saved object migration system and are working on adding a formal state migration system, introducing state changes and migrations in a minor always comes with a risk. Consider this before making huge and risky changes in minors, especially to saved objects.
Be very careful when changing the shape of saved objects or persistable data.
Saved object exported from past {{kib}} versions should continue to work. In addition, if users are relying on state stored in your app’s URL as part of your public contract, keep in mind that you may also need to provide backwards compatibility for bookmarked URLs.
The {{kib}} platform provides a set of tools to help developers build consistent experience around routing and browser navigation. Some of that tooling is inside core, some is available as part of various plugins.
Follow this guide to get an idea of available tools and common approaches for handling routing and browser navigation.
Review: