jscutlery / convoyr Goto Github PK
View Code? Open in Web Editor NEWModular HTTP extensions for Angular.
License: MIT License
Modular HTTP extensions for Angular.
License: MIT License
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
A plugin that re-fetch data by :
Lerna needs dist
files in directory relative to the package.
We are currently copying that package manually on prepublish. This is cumbersome and error prone.
Maybe we should configure that dist directory in angular.json
(but we have to remember to do that again when we create new libs).
We could also just build the needed package in prepublish script instead of build everything with nx before.
In this RFC we propose adding an HTTP client wrapper for Convoyr.
After some discussions with @yjaaidi we think that Convoyr should benefit from having its own HTTP client. Actually we're facing two major issues with Convoyr :
HttpInterceptor
which are powerful for handling some global features, like authentication, but is heavily missing a per request plugin mechanism.@convoyr/core
was initially built with this aspect in mind, but here also, the use of interceptors is very limiting for extending the Node.js platform.One basic example.
convoyr.get('/service', { plugins: [createCachePlugin()] })
Another example with Angular.
export class BikeSearchComponent {
searchControl = new FormControl();
bikes$ = this.searchControl.valueChanges.pipe(
startWith(''),
switchMap((query) =>
this.convoyr.get<{ bikes: Bike[] }>(
environment.apiBaseUrl + '/bikes',
{
params: { q: query },
plugins: [createCachePlugin()],
}
)
),
shareReplay({ bufferSize: 1, refCount: true })
);
constructor(private convoyr: Convoyr) {}
}
Some subtle aspects of this design that we especially appreciate :
HttpClient
,Execution plan for Angular :
Convoyr.get => Plugin A => Plugin B => Convoyr Angular Adapter => HttpClient.get(...)
For Axios :
Convoyr.get => Plugin A => Plugin B => Convoyr Axios Adapter => Axios.get(...)
NOTE: Suggestions or comments are highly appreciated.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These problems occurred while renovating this repository. View logs.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@angular-devkit/build-angular
, @angular/cli
)@types/jest
, jest
)@types/jest
, jest
, ts-jest
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@nrwl/cypress
, @nrwl/jest
, @nrwl/node
, @nrwl/workspace
)@angular-devkit/build-angular
, @angular/cli
)@commitlint/cli
, @commitlint/config-angular
, @commitlint/config-conventional
)@angular/animations
, @angular/common
, @angular/compiler
, @angular/compiler-cli
, @angular/core
, @angular/forms
, @angular/language-service
, @angular/platform-browser
, @angular/platform-browser-dynamic
, @angular/router
)@angular/cdk
, @angular/material
)@nrwl/angular
, @nrwl/cypress
, @nrwl/express
, @nrwl/jest
, @nrwl/node
, @nrwl/workspace
).github/workflows/ci.yml
actions/checkout v2
actions/setup-node v1
actions/cache v2
actions/checkout v2
actions/setup-node v1
actions/cache v2
actions/checkout v2
actions/setup-node v1
actions/cache v2
codecov/codecov-action v2.1.0
libs/angular/package.json
tslib ^2.0.0
@angular/common >= 9.1.11
@angular/core >= 9.1.11
rxjs ^6.5.4
libs/core/package.json
tslib ^2.0.0
rxjs ^6.5.4
libs/plugin-auth/package.json
tslib ^2.0.0
rxjs ^6.5.4
libs/plugin-cache/package.json
buffer ^6.0.0
bytes ^3.1.0
lru-cache ^6.0.0
tslib ^2.0.0
rxjs ^6.5.4
libs/plugin-retry/package.json
backoff-rxjs ^6.3.3
tslib ^2.0.0
rxjs ^6.5.4
package.json
@angular/animations ^11.0.1
@angular/cdk ^11.0.0
@angular/common ^11.0.1
@angular/compiler ^11.0.1
@angular/core ^11.0.1
@angular/flex-layout ^9.0.0-beta.31
@angular/forms ^11.0.1
@angular/material ^11.0.0
@angular/platform-browser ^11.0.1
@angular/platform-browser-dynamic ^11.0.1
@angular/router ^11.0.1
@nrwl/angular ^11.0.0
body-parser ^1.19.0
core-js ^3.6.4
cors ^2.8.5
express 4.19.2
rxjs ~6.6.0
tslib ^2.0.0
zone.js ~0.11.0
@angular-devkit/build-angular ~0.1102.0
@angular/cli 11.2.15
@angular/compiler-cli ^11.0.1
@angular/language-service ^11.0.1
@commitlint/cli 12.1.4
@commitlint/config-angular ^12.0.0
@commitlint/config-conventional ^12.0.0
@hirez_io/observer-spy ^2.0.0
@nrwl/cypress 11.3.1
@nrwl/express ^11.0.0
@nrwl/jest 11.3.1
@nrwl/node 11.3.1
@nrwl/workspace 11.3.1
@types/express 4.17.13
@types/jest 27.0.3
@types/lru-cache ^5.1.0
@types/node ^16.0.0
all-contributors-cli ^6.12.0
codelyzer ^6.0.0
cypress 6.9.1
dotenv 10.0.0
eslint 7.32.0
husky ^6.0.0
jest 27.4.3
jest-date-mock ^1.0.8
jest-preset-angular 8.4.0
lerna ^4.0.0
lint-staged 11.1.2
ng-packagr ^11.0.0
npm-run-all ^4.1.5
prettier 2.5.1
rxjs-marbles ^7.0.0
ts-jest 27.1.5
ts-node ~9.1.0
tsickle ^0.43.0
tslint ~6.1.0
typescript ~4.1.0
I just installed this plugin with the settings you defined in the readme in my AppModule. Immediately, a form directive that was using the code below started failing. Upon further inspection, we could see that it would only include the last param we set. The moment we removed convoyr from AppModule, both request params were back on the url.
Example:
@Injectable({providedIn: 'root'})
export class HotelUrlNameService {
isUrlNameAvailable(hotelIdentifier: string, urlName: string): Observable<UniqueResult> {
const params = new HttpParams()
.set('hotelIdentifier', hotelIdentifier)
.set('urlName', urlName)
;
return this.httpClient.get<UniqueResult>(`${this.environment.inventoryAPIEndpointBaseURL}/api/administration/hotel/urlname`, { params });
}
constructor(private readonly httpClient: HttpClient,
@Inject(ENVIRONMENT) private readonly environment: any) {
}
}
In the same way Angular exposes url
and urlWithParams
properties to HttpRequest
, we can add a util function to get the same result from urlWithParams
to simplify query-string usage in plugins.
See the install guide, the migration guide and this blog post for informations.
A specific cache plugin for ReSTful API, probably based on the current cache plugin could improve caching by understanding the semantics of the API.
Here are some examples:
GET /items => {items: [{id: '123', name: 'demo'}]}
GET /items/123 => cache hit => {id: '123', name: 'demo'}
(PATCH|PUT) /items/123 {name: 'updated demo'} => {id: '123', name: 'updated demo'} => update item in storage using response
GET /items => {items: [{id: '123', name: 'updated demo'}]}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.