fetch-client
fetch-client copied to clipboard
Is this package version number following semver?
Background:
Recently I had to wipe out my old package-lock.json
which kept me at 1.4.x
because I lost access to the private instance of NPM registry I used to have.
Current latest was installed: 1.8.2
Problem: It made my app throw errors saying some function from _aureliaPal.DOM is not there.
Solution:
Eventually I found out that there's aurelia-pal
and aurelia-pal-browser
now and one needs to call initialize
. Everything is OK now.
But that made me think: the constraint was expressed ^1.4.0
so npm was allowed to install 1.8.2
once I removed the lock. The problem is that 1.5.0
is not backwards compatible with 1.4.0
. It's requird to initialize the PAL. Once I found that out I was like: "PAL is really a great idea!", but there's also no notice about that in the readme.
I imagine users of aurelia-fetch-client
inside aurelia-framework
have no such problem (I have no aurelia apps to find out quickly)
I suggest at least a notice about how to use the aurelia-fetch-client
package stand-alone should be added to the readme. I'm using aurelia-fetch-client
stand-alone, without aurelia-framework
. I do it because I like its features but the app it's used in is not aurelia app. It would be great to have it mentioned in readme in here and in any other packages suitable to be used stand-alone as well.
I guess when we made that changes, this module being used in non-Aurelia apps was not considered carefully. So, for Aurelia apps: not a breaking change. For non-Aurelia apps: it was a breaking changes. Now, it's hard to answer your Q
That's what I guessed :)
I'm aware that stand-alone usage is not a first-class usage, but I'd like to raise awareness on that. I'd be grateful if this example made the team consider such usage in the future
I'm not currently aware of where's the best place to put the informacji about necessity to use aurelia-pal-browser
. I know that being a user of aurelia-fetch-client
stand alone I'd look for such information either in README.md of the package (most obvious way) or maybe in package docs on aurelia page
Maybe a good way would be to add a section about stand-alone usage linking to an article in the docs?
Would an explicit peerdependency on the respective version of pal help?
Would an explicit peerdependency on the respective version of pal help?
Setting aurelia-pal-browser
as a peer dependency of aurelia-fetch-client
, right?
This might help but I'm not sure if it will draw as much attention as it deserves (all in all - if the PAL is not initialized then client will fail on first request)
I also have an idea: checking if PAL is initialized when client is created and warning the developer in console.
It will be a message just in time.
What are the versions? Looking at NPM and it goes from 0.9.0 (I'm not counting 0.10.0-dev* as releases for general usage) to 2.* alpha/dev. 1.* is completely missing.
https://www.npmjs.com/package/@aurelia/fetch-client