diff --git a/README.md b/README.md index 118ffc5a..1022b576 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ Are you new to Owl? This is the place to start! - [Component](doc/reference/component.md) - [Component Lifecycle](doc/reference/component.md#lifecycle) - [Concurrency Model](doc/reference/concurrency_model.md) +- [Dev mode](doc/reference/app.md#dev-mode) - [Dynamic sub components](doc/reference/component.md#dynamic-sub-components) - [Environment](doc/reference/environment.md) - [Error Handling](doc/reference/error_handling.md) diff --git a/doc/reference/app.md b/doc/reference/app.md index e19dc1f6..9c403ad2 100644 --- a/doc/reference/app.md +++ b/doc/reference/app.md @@ -51,11 +51,10 @@ The `config` object is an object with some of the following keys: - **`env (object)`**: if given, this will be the shared `env` given to each component - **`props (object)`**: the props given to the root component -- **`dev (boolean, default=false)`**: if `true`, the application is rendered in `dev` - mode, which activates some additional checks (in particular, the props validation - code is only performed in dev mode) +- **`dev (boolean, default=false)`**: if `true`, the application is rendered in + [`dev` mode](#dev-mode); - **`test (boolean, default=false)`**: `test` mode is the same as `dev` mode, except - that Owll will not log a message to warn that Owl is in `dev` mode. + that Owl will not log a message to warn that Owl is in `dev` mode. - **`translatableAttributes (string[])`**: a list of additional attributes that should be translated (see [translations](translations.md)) - **`translateFn (function)`**: a function that will be called by owl to translate @@ -110,3 +109,15 @@ const { loadFile, mount } = owl; mount(Root, document.body, { env }); })(); ``` + +## Dev mode + +Dev mode activates some additional checks and developer amenities: + +- [Props validation](./props.md#props-validation) is performed +- [t-foreach](./templates.md#loops) loops check for key unicity +- Lifecycle hooks are wrapped to report their errors in a more developer-friendly way +- Component nodes (the `__owl__` property on components) have an additional "subscriptions" + property, containing a list of objects that the component is observing through the reactivity + system, as well as which keys are observed for each object, which can be useful for + debugging extraneous or missing renders