Skip to content

Commit 39414bd

Browse files
nickschotpichfl
authored andcommitted
Fix syntax highlighting
1 parent f5eccb5 commit 39414bd

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

text/0000-route-manager-api.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This RFC is **not** intended to describe APIs that Ember app developers would ge
5050

5151
The minimal API for a Route Manager consists of `capabilities`, `createRoute` and a `getDestroyable` method.
5252

53-
```ts
53+
```typescript
5454
interface RouteManager {
5555
capabilities: Capabilities;
5656

@@ -85,7 +85,7 @@ The `getDestroyable` method takes a `RouteStateBucket` and will return the `Dest
8585

8686
This follows the same pattern as existing manager implementations. This method will be used by the framework for the Route Base Classes it provides as well as by non-framework code wanting to provide their own Route Manager implementation.
8787

88-
```ts
88+
```typescript
8989
// Takes a Factory function for the Manager with an Owner argument and
9090
// the Route base object/class/function for which the manager applies.
9191
setRouteManager: (
@@ -98,7 +98,7 @@ setRouteManager: (
9898

9999
The NavigationState is an interface for the router to pass information to the manager methods. This interface can be extended with capabilities in the future.
100100

101-
```ts
101+
```typescript
102102
// Passed in to the lifecycle methods
103103
interface NavigationState {
104104
from: RouteInfo | undefined;
@@ -117,7 +117,7 @@ The `RouteInfo` classes refer to the existing public API `RouteInfo` as specifie
117117

118118
The `NavigationActions` interface defines any actions that some of the manager hooks are allowed to call. For now this is just the `cancel` action which stops the current navigation. The implementation details are left to the router, but will at least need to abort the `signal` defined in the [`AsyncNavigationState` interface](#asyncnavigationstate-interface).
119119

120-
```ts
120+
```typescript
121121
interface NavigationActions {
122122
// Cancels the current navigation
123123
cancel: () => void;
@@ -134,7 +134,7 @@ The `signal` is an `AbortSignal` provided by the Router which can be used to rea
134134

135135
In addition, the Router will need to provide a method to the Route Managers to retrieve the [`resolvedContext`](#resolvedcontext) of a Route based on its `RouteInfo`.
136136

137-
```ts
137+
```typescript
138138
// Exposes API used to interact with the active navigation, like awaiting ancestor's async behaviour.
139139
interface AsyncNavigationState {
140140
// Signal for the current navigation
@@ -160,7 +160,7 @@ This RFC proposes 3 groups of hooks for lifecycle management of a Route.
160160

161161
The main lifecycle methods are accompanied by synchronous will*/did* methods. This gives the possibility of implementing lifecycle features like cancelling/preventing a route change, cleaning up after a route branch was fully exited. `update` and `enter` are promise-aware and will be awaited. These methods give the option to do asynchronous work that needs to happen before rendering.
162162

163-
```ts
163+
```typescript
164164

165165
interface RouteManager {
166166
// Lifecycle hook called when the Route is about to be entered.
@@ -239,7 +239,7 @@ Any time the Classic Router interfaces with the RouteManager in a way we do not
239239

240240
A separate optional capability will be introduced to access the last resolved value of the model hook (equivalent). This leaves open the possibility of asynchronous lifecycle combined with routes accessing ancestor model data through use of the `getResolvedContext` method. A route manager may choose not to implement this capability.
241241

242-
```ts
242+
```typescript
243243
interface RouteManagerWithResolvedContext = RouteManager & {
244244
// Get the current resolved context (a.k.a. model) from the RouteStateBucket
245245
resolvedContext(bucket: RouteStateBucket) => unknown;
@@ -250,7 +250,7 @@ interface RouteManagerWithResolvedContext = RouteManager & {
250250

251251
When the `classicInterop` capability is set to `true` the Route Manager will have to provide an implementation for the methods that cross the Route Manager boundary to recreate the current Classic Router behaviour. The following list is a best-effort to find those methods, but it may need to change during implementation. The capability that opts in to these functions is not intended to be implemented by any other future Route Manager.
252252

253-
```ts
253+
```typescript
254254
// Classic Router interoperability
255255
interface RouteManagerWithClassicInterop = RouteManager & {
256256
getRouteName(bucket: RouteStateBucket) => string;
@@ -275,7 +275,7 @@ The necessary state will be taken from and stored in the passed `RouteStateBucke
275275

276276
With the Classic Router, rendering is handled through `RenderState` objects combined with a (scheduled once) call to `router._setOutlets` which updates the render state tree with the new `RenderState` objects from the current routes. This looks something like:
277277

278-
```ts
278+
```typescript
279279
let render: RenderState = {
280280
owner,
281281
name,
@@ -289,7 +289,7 @@ For the Route Manager API we will rework this structure to a generic invokable.
289289

290290
The return value of `getInvokable` is an object that needs to have an associated `ComponentManager`.
291291

292-
```ts
292+
```typescript
293293
interface RouteManager {
294294
getInvokable: (bucket: RouteStateBucket) => object;
295295
}

0 commit comments

Comments
 (0)