@ng-desktop/http 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -8
- package/fesm2022/http-backend.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@ng-desktop/http`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
OS-native HTTP/2 backend (`NativeHttpBackend`) and reactive `createNativeHttpResource()` implementing `@angular/common/http` (`provideHttpClient`, interceptors, caching, parallel batching, and XSRF configuration) over Rust native transport (`libsoup-3.0` on Linux).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
5
|
+
## Install
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
pnpm add @ng-desktop/http
|
|
8
|
+
pnpm add @ng-desktop/http @ng-desktop/platform
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
Peer dependencies: `@angular/core >= 22.0.0`, `@angular/common >= 22.0.0`, `@ng-desktop/platform`.
|
|
12
|
+
|
|
13
|
+
## Quick Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { ApplicationConfig } from '@angular/core';
|
|
17
|
+
import { provideHttpClient, withFetch, withXsrfConfiguration } from '@ng-desktop/http';
|
|
18
|
+
|
|
19
|
+
export const appConfig: ApplicationConfig = {
|
|
20
|
+
providers: [
|
|
21
|
+
provideHttpClient(
|
|
22
|
+
withFetch(),
|
|
23
|
+
withXsrfConfiguration({
|
|
24
|
+
cookieName: 'XSRF-TOKEN',
|
|
25
|
+
headerName: 'X-XSRF-TOKEN',
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Key Exports
|
|
33
|
+
|
|
34
|
+
- `provideHttpClient`, `provideNativeHttpClient`, `NativeHttpBackend`
|
|
35
|
+
- `withFetch`, `withInterceptors`, `withInterceptorsFromDi`, `withHttpCaching`, `withParallelBatching`, `withXsrfConfiguration`, `withNoXsrfProtection`, `withNativeHttpConfig`
|
|
36
|
+
- `createNativeHttpResource`, `NATIVE_HTTP_CONFIG`, `resolveNativeHttpConfig`
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
- [Getting Started with External Angular 22+ & Nx Apps](../../docs/GETTING_STARTED.md)
|
|
41
|
+
- [Architectural Roadmap & OS Maturity Matrix](../../ROADMAP.md)
|
package/fesm2022/http-backend.js
CHANGED
|
@@ -250,10 +250,10 @@ export class NativeHttpBackend {
|
|
|
250
250
|
return undefined;
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
254
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.
|
|
253
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeHttpBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
254
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeHttpBackend, providedIn: 'root' });
|
|
255
255
|
}
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeHttpBackend, decorators: [{
|
|
257
257
|
type: Injectable,
|
|
258
258
|
args: [{ providedIn: 'root' }]
|
|
259
259
|
}] });
|