question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bring the router service to engines

See original GitHub issue

Would be really cool, if we could bring the RouterService to engines as well. I propose keeping the exact same API, but adding an *External variant for all methods, just like we are doing with the route extension:

https://github.com/ember-engines/ember-engines/blob/ec4d1ae7a413a7e5d9e57a4e3b2e0f0d19a0afcd/addon/-private/route-ext.js#L14-L17

Implementing a proper RouterService for engines would also allow us to refactor the route-ext and also add the missing *External methods to Route and Controller for symmetry.

I’ve done a PoC service which I am using for my projects, but it would be great to have an official solution that does not rely on dirty hacks.

Links

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:12
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
buschtoenscommented, Apr 16, 2019

@villander No worries, I understood you right the first time. ☺️

The idea behind engines is to encapsulate a part of the application from the rest. Any references / dependencies to the host app should be explicit and declarative. This is why services are explicitly injected into the engine. The same goes for routes (externalRoutes).

Allowing users to transitionToExternal by URL would break with that principle. The fully qualified URL can only be known by the host app. This detail should thus not be exposed to / accessible by the engine. The engine only knows about the externalRoutes names.

The need to transition by URL from inside an engine is an indicator for a leaky engine that is not fully encapsulated. Imagine it this way: You should be able to take that engine and drop it into any other app and be able to run it, as long as the expected external services and externalRoutes were passed into the engine.

If you still, for whatever reason, need to trigger a transition by URL from inside the engine, you can pass the host app’s “real” router service into the engine as external-router and call transitionTo on it directly.

1reaction
buschtoenscommented, May 13, 2022

PSA for anyone subscribed to this issue: @SergeAstapov has submitted RFC 819 “Public router service”, which makes the RouterService available to engines in accordance with #691 “Merge internal and external route namespace, drop *External methods & <LinkToExternal>”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cisco Integrated Storage System CLI Administrator Guide
Enters global configuration mode on the host router. Step 3. interface integrated-service-engine slot/0. Example: Router(config)# interface ...
Read more >
Cisco ISR G2: Services Ready Engine - YouTube
Brief demonstration showing how services can be delivered ... Cisco ISR G2: Services Ready Engine ... On the Inside - Cisco 2811 Router....
Read more >
Cisco 3900 Series Integrated Services Router - Configuring ...
... Services Router - Configuring Services Ready Engine (SRE) Service Modules ... Procedure to configure the SRE service module interface on the Cisco...
Read more >
Use swarm mode routing mesh - Docker Documentation
Docker Engine swarm mode makes it easy to publish ports for services to make them available to resources outside the swarm. All nodes...
Read more >
Routing Engine Overview - Technical Documentation - Support
The Routing Engine is a key component in the router. It is primarily responsible for the protocol intelligence of the router. Thus, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found