Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History Service: Make it possible to push multiple consumer locations #441

Closed
unstubbable opened this issue Mar 22, 2019 · 3 comments · Fixed by #518
Closed

History Service: Make it possible to push multiple consumer locations #441

unstubbable opened this issue Mar 22, 2019 · 3 comments · Fixed by #518

Comments

@unstubbable
Copy link
Member

unstubbable commented Mar 22, 2019

To trigger a navigation from a Feature App to another page that composes a different set of Feature Apps, some kind of navigation Feature Service that encapsulates integrator routing logic would be needed.

Such a Feature Service would have the need to collect consumer locations from multiple Feature Services, and then push a root location that combines these consumer locations to the root history.

To accomplish that, the following changes to the History Service are proposed:

+export interface ConsumerLocation {
+  readonly historyKey: string;
+  readonly location: history.Location;
+}
+
+export interface RootHistory {
+  push(location: history.Location): void;
+  replace(location: history.Location): void;
+  createHref(location: history.Location): string;
+  createLocation(...consumerLocations: ConsumerLocation[]): history.Location;
+}
+
 export interface HistoryServiceV1 {
+  readonly historyKey: string;
+  readonly browserRootHistory: RootHistory;
+  readonly staticRootHistory: RootHistory;
+
+  /**
+   * @deprecated Use [[staticRootHistory.location]] instead.
+   */
   readonly staticRootLocation: history.Location;
 
   createBrowserHistory(): history.History;
   createStaticHistory(): history.History;
}
@clebert
Copy link
Member

clebert commented May 20, 2019

New Proposal as discussed with Stefan:

export interface ConsumerLocation {
  readonly historyKey: string;
  readonly location: history.Location;
}

export interface RootHistoryV2 {
  readonly location: history.Location;

  push(location: history.Location): void;
  replace(location: history.Location): void;
  createHref(location: history.Location): string;
  createLocation(...consumerLocations: ConsumerLocation[]): history.Location;
}

export interface HistoryServiceV2 {
  readonly historyKey: string;
  readonly history: history.History;
  readonly rootHistory: RootHistoryV2;
}

@clebert
Copy link
Member

clebert commented May 20, 2019

Shouldn't historyKey actually be called consumerHistoryKey?

@unstubbable
Copy link
Member Author

RootHistoryV2 also needs location.

@clebert clebert modified the milestones: Backlog, 2.0 Jun 10, 2019
unstubbable added a commit that referenced this issue Jun 27, 2019
…ation

Co-authored-by: Stefan Meyer <stefan.meyer@sinnerschrader.com>

closes #496
fixes #441
unstubbable added a commit that referenced this issue Jun 27, 2019
…ation

closes #496
fixes #441

Co-authored-by: Stefan Meyer <stefan.meyer@sinnerschrader.com>
unstubbable added a commit that referenced this issue Jul 4, 2019
…ation

closes #496
fixes #441

Co-authored-by: Stefan Meyer <stefan.meyer@sinnerschrader.com>
unstubbable added a commit that referenced this issue Jul 5, 2019
…ation (#518)

closes #496
fixes #441

Co-authored-by: Stefan Meyer <stefan.meyer@sinnerschrader.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants