Skip to content

Commit 1eae85a

Browse files
committed
fix: restore RxJS 6 compatibility for Angular 21
Revert the branch to RxJS 6 and align published peer constraints with upstream hyperdash requirements. Add a shared Vitest runner config so Angular 21 tests resolve correctly when RxJS 6 is installed.
1 parent 54cc60d commit 1eae85a

File tree

6 files changed

+111
-7
lines changed

6 files changed

+111
-7
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ Install Node + NPM
1111

1212
`npm install`
1313

14+
## RxJS Compatibility
15+
16+
`@hypertrace/hyperdash-angular` currently uses `rxjs` `^6.5.5`.
17+
18+
The library code is kept compatible with both RxJS 6 and RxJS 7 import styles where practical, but
19+
published compatibility currently follows `@hypertrace/hyperdash` peer requirements.
20+
1421
## Development server
1522

1623
Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

angular.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"buildTarget": "hyperdash-angular-app:build",
8484
"tsConfig": "tsconfig.spec.json",
8585
"runner": "vitest",
86+
"runnerConfig": "vitest.config.ts",
8687
"reporters": ["default", ["junit", { "outputFile": "test-results/hyperdash-angular-app/results.xml" }]]
8788
}
8889
},
@@ -118,6 +119,7 @@
118119
"buildTarget": "hyperdash-angular:build",
119120
"tsConfig": "projects/hyperdash-angular/tsconfig.spec.json",
120121
"runner": "vitest",
122+
"runnerConfig": "vitest.config.ts",
121123
"coverage": true,
122124
"coverageInclude": ["projects/hyperdash-angular/src/**/*.ts"],
123125
"coverageExclude": ["**/*.module.ts", "**/public_api.ts", "projects/hyperdash-angular/src/test/**"],

package-lock.json

Lines changed: 74 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@angular/platform-browser-dynamic": "^21.1.5",
2727
"@hypertrace/hyperdash": "^1.4.1",
2828
"lodash-es": "^4.17.21",
29-
"rxjs": "^7.8.2",
29+
"rxjs": "^6.5.5",
3030
"tslib": "^2.8.1"
3131
},
3232
"devDependencies": {

projects/hyperdash-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@angular/common": "^21.0.0",
1818
"@angular/core": "^21.0.0",
1919
"@angular/platform-browser": "^21.0.0",
20-
"rxjs": "^7.8.2",
20+
"rxjs": "^6.5.5",
2121
"lodash-es": "^4.17.21",
2222
"@hypertrace/hyperdash": "^1.3.0"
2323
},

vitest.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig } from 'vitest/config';
2+
import { createRequire } from 'node:module';
3+
4+
const require = createRequire(import.meta.url);
5+
const rxjsVersion: string = require('rxjs/package.json').version;
6+
const isRxjs6 = rxjsVersion.startsWith('6.');
7+
8+
export default defineConfig({
9+
resolve: {
10+
alias: isRxjs6
11+
? {
12+
// RxJS 6 does not expose directory imports through package exports.
13+
'rxjs/operators': 'rxjs/operators/index.js',
14+
'rxjs/testing': 'rxjs/testing/index.js'
15+
}
16+
: {}
17+
},
18+
test: {
19+
server: {
20+
deps: {
21+
// Ensure Vite transforms dependencies instead of externalizing to Node.
22+
inline: true
23+
}
24+
}
25+
}
26+
});

0 commit comments

Comments
 (0)