-
Notifications
You must be signed in to change notification settings - Fork 439
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
Make pretender a peer dependency #1389
Make pretender a peer dependency #1389
Conversation
After looking a little more into this I think the |
Let's let the consumer of this addon decide which version of Pretender is best for them.
0941758
to
9805c3f
Compare
Why ecli-pretender and not just pretender? |
Would auto-import obviate the need for ecli-pretender? |
The gist is that using Pretender means that you need to install a bunch of ancillary packages (see pretenderjs/pretender#221). It seems kind of wacky to duplicate this effort when @rwjblue has gone to the effort of doing this work for us in ecli-pretender. The challenge seems to be that nested addons are bit of a gong show. The gist is that you sort of have to "hoist" up some dependencies. This is the part I could use some help on. |
I see. Ya this stuff is tricky... I personally don't know the right answer here |
Well, the ultimate goal I had when I started this was to get Pretender 2
working. I’m going to double back on that. We can return to this specific
idea later pending any insight from someone more experienced on this
matter.
…On Mon, Oct 1, 2018 at 21:52 Sam Selikoff ***@***.***> wrote:
I see. Ya this stuff is tricky... I personally don't know the right answer
here
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1389 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAM5Hmr5B-J7W-WrmceFoAMJ3SPP9nFks5ugsbmgaJpZM4XBCtf>
.
|
Hi @jherdman sorry I just noticed this from cross reference. |
@xg-wang many thanks for the response! Out of curiosity, why not make pretender a peer dep? It'd certainly give users greater control over which version of Pretender they could use? |
@jherdman IMO mirage is a higher level abstraction than pretender, it should hide its underlying impl and just provide its DSL for app. It should be mirage rather than consuming app's duty to take care of pretender. |
@xg-wang In an ideal world I'd agree, however the reality is that I don't have the time or resources to make every Pretender API that Mirage users would find valuable available via a Mirage-specific API. I made the choice at the beginning to expose I think in OSS projects like this, this compromised middle road is the best path forward – exposing the underlying bits in a way that doesn't compromise the higher level APIs, so folks who get stuck behind a limitation of Mirage's APIs can dig down further if they need or want to. Question: Is there a way to make Pretender a peerDependency of Mirage, but for Mirage to "supply" a version by default if the host app doesn't explicitly install it? |
Could you not do something like the following? (And not make it a peer dep).
|
@samselikoff I think a reasonable compromise in the mean time is to do the Pretender upgrade (see #1392), and continue to chip away at this problem in general. This would at least unlock |
Sorry for the breaking change, I pushed another change to the pending PR in pretender. Link tested it won't break ember-cli-mirage tests. |
After lots of back and forth, I think the best path forward today to solve this problem is to point people towards yarn resolutions. npm peer dependencies are good in theory, but do not have widespread support among tooling layers nor adoption in our community. For instance, every addon technically has a peer dependency on Given the current state of things, If users want to override the version of a dependency like Pretender (or any other transitive dependency of their project), they can do so with yarn resolutions. For more info check out #1497. |
Let's let the consumer of this addon decide which version of Pretender
is best for them.
Important Notes
Questions