Skip to content

Commit

Permalink
fixup! address review + update links
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos committed May 5, 2020
1 parent 9a815ca commit 4f1effc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 39 deletions.
3 changes: 3 additions & 0 deletions docs/site/migration/components/current-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ information. For example:
- `@inject.setter(key)` to obtain a setter function for writing values to the
context

To keep the contextual data per-request (as opposed to per-application), the
`TRANSIENT` binding scope should be used.

Components can keep using the old `options`-based approach where it makes more
sense than Dependency Injection, typically when working with existing
`options`-based code like Repository APIs.
38 changes: 16 additions & 22 deletions docs/site/migration/components/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ following GitHub issue:
[loopback-next#3955](https://github.com/strongloop/loopback-next/issues/3955)
" %}

<!--
FIXME: Create a new follow-up task to create a diagram per Raymond's comment:
> Maybe a diagram would help if it shows the handshake between an application
> and a component as well as typical artifacts exported from a component.
-->

In LoopBack 3, a component is essentially a function that extends and/or patches
the target application.

Expand All @@ -45,24 +39,24 @@ import those artifacts.

LoopBack 4 components can contribute:

<!-- FIXME change items to links pointing to doc pages -->

- Model and Entity classes
- Mixins
- Sequence Actions
- Controllers
- Life cycle observers
- Repositories
- Service proxies
- Servers
- Extensions for Extension Points
- Booters
- Model API builders
- [Model and Entity classes](../../Model.md)
- [Mixins](../../Mixin.md)
- [Decorators](../../Creating-decorators.md)
- [Sequence Actions](../../Sequence.md#actions)
- [Controllers](../../Controllers.md)
- [Life cycle observers](../../Extension-life-cycle.md)
- [Repositories](../../Repositories.md)
- [Service proxies](../../Calling-other-APIs-and-Web-Services.md)
- [Servers](../../Creating-servers.md)
- [HTTP request parsers](../../Extending-request-body-parsing.md)
- Extensions for [Extension Points](../../Extension-point-and-extensions.md)
- [Booters](../../Booting-an-Application.md#custom-booters)
- [Model API builders](../../Extending-Model-API-builder.md)
- Extensions for Extension Points defined by 3rd-party component
- Any other values to be bound in `Application`'s context:
- Classes
- Providers
- Arbitrary bindings (instances of `Binding` class)
- [Classes](../../Binding.md#a-class)
- [Providers](../../Binding.md#a-provider)
- [Arbitrary bindings](../../Binding.md) (instances of `Binding` class)

As the last resort, LoopBack 4 components can also modify the target application
directly by calling `Application` APIs (this is similar to LoopBack 3 approach).
Expand Down
19 changes: 2 additions & 17 deletions docs/site/migration/components/project-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,5 @@ repository. We recommend to create a new project using
incrementally migrate artifacts from the original LoopBack 3 component to the
new project.

<!--
FIXME: create a follow-up task to update Extension template to follow
the latest style as used by `extensions/metrics`:
- inject the target app and component config to the component class,
- provide `src/keys.ts` exporting `{ComponentName}Keys.COMPONENT` binding key,
- decorate the component class with `@bind()`,
- include generic Basic Use instructions in the scaffolded README file.
As part of this task, we should also revisit the pages "Creating components"
and "Using components", to make sure they are consistent with this migration
guide and the updated generator (project template). For example, the pages
should explain how to receive and provide component config via `@config` and
`this.configure()` API, and so on.
When the issue is created, then add a "note" paragraph here with a link to the
new issue and a short explanation that users must make those changes manually
for now.
-->
{% include note.html content="The extension project template used by `lb4 extension` is a bit outdated now, please refer to [loopback-next#5336](https://github.com/strongloop/loopback-next/issues/5336) for more details.
" %}

0 comments on commit 4f1effc

Please sign in to comment.