Skip to content

Commit

Permalink
Testem Middleware RFC: add the one-liner alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
lolmaus committed Dec 7, 2023
1 parent eca6dde commit a9f4eca
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions text/0000-testem-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ An "Ember app" mentioned throughout this RFC means a v1 app, as v2 apps (Embroid
## Alternatives
### Use the in-repo addon workaround
The fact that some important Ember CLI hooks are only available to addons and not the app — is a known problem in the Ember community. A de-facto solution is to add an in-repo addon to the app. Such addon can define a middleware hook that provides both inline middleware and forwards middleware from v2 addons.
Pros:
Expand All @@ -148,6 +150,24 @@ Cons:
* This pattern is a workaround for an Ember CLI shortcoming, not a real solution.
* Relying on Testem's own config file is the v2 path forward, and using an in-repo addon delays it.

### Have Ember CLI merge middleware from addons with middleware from testem.js

Pros:

* Likely a one-liner that can be categorized as a bugfix.

Cons:

* It solves only two goals out of three:

✅ Define its own middleware.
✅ Pass on middleware provided by v2 addons.
❌ Opt in or out of Ember CLI including middelware provided by v1 addons.

Must admit that opting out of addon-provided Testem middleware is a rare requirement.

* It does not push app and addon maintainers to adopt the Embroider-friendly path.

## Unresolved questions

❓ Should this feature be backported to older Ember CLI versions?

0 comments on commit a9f4eca

Please sign in to comment.