From 33a1a465eaef797ebaad848a85c755d76bb9065a Mon Sep 17 00:00:00 2001 From: dannyrb Date: Sat, 7 Dec 2019 00:49:40 -0500 Subject: [PATCH] docs: lifecycle hooks summary --- docs/latest/extensions/index.md | 16 +++++++++++----- .../extensions/lifecycle/pre-registration.md | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/latest/extensions/index.md b/docs/latest/extensions/index.md index e8a8e343e..e834dfe06 100644 --- a/docs/latest/extensions/index.md +++ b/docs/latest/extensions/index.md @@ -91,18 +91,17 @@ const config = { } ``` -#### Runtime Extensions +#### Registering at Runtime The `@ohif/viewer` uses a [configuration file](#) at startup. The schema for that file includes an `Extensions` key that supports an array of extensions to register. -#### Bundled Extensions +#### Registering at Build Time The `@ohif/viewer` works best when built as a "Progressive Web Application" (PWA). If you know the extensions your application will need, you can specify -them at "build time" to leverage some advantaged afforded to us by modern -tooling: +them at "build time" to leverage advantages afforded to us by modern tooling: - Code Splitting - Tree Shaking @@ -116,7 +115,14 @@ You can update the list of bundled extensions by: ### Lifecycle Hooks -... +Currently, there is only a single lifecycle hook for extensions: +[`preRegistration`](./lifecycle/pre-registration.md) + +If an extension defines the [`preRegistration`](./lifecycle/pre-registration.md) +lifecycle hook, it is called before any modules are registered in the +`ExtensionManager`. It's most commonly used to wire up extensions to +[services](./../services/index.md) and [commands](./modules/commands.md), and to +bootstrap 3rd party libraries. ### Modules diff --git a/docs/latest/extensions/lifecycle/pre-registration.md b/docs/latest/extensions/lifecycle/pre-registration.md index a4cef9957..30008556b 100644 --- a/docs/latest/extensions/lifecycle/pre-registration.md +++ b/docs/latest/extensions/lifecycle/pre-registration.md @@ -1,7 +1,7 @@ # Lifecylce Hook: preRegistration If an extension defines the `preRegistration` lifecycle hook, it is called -before any modules are registered to the `ExtensionManager`. +before any modules are registered in the `ExtensionManager`. ```js export default {