Merged PR 1970: feat(stock-info): implement request batching with BatchingResource - The main implementation

Related work items: #5348
This commit is contained in:
Lorenz Hilpert
2025-10-16 11:48:33 +00:00
committed by Nino Righi
parent b5c8dc4776
commit e458542b29
17 changed files with 1140 additions and 228 deletions

View File

@@ -46,6 +46,9 @@ npm run build
npm run build-prod
# Or: npx nx build isa-app --configuration=production
# Build without using Nx cache (for fresh builds)
npx nx build isa-app --skip-nx-cache
# Serve the application with SSL (development server)
npm start
# Or: npx nx serve isa-app --ssl
@@ -55,17 +58,21 @@ npm start
```bash
# Run tests for all libraries except the main app (default command)
npm test
# Or: npx nx run-many -t test --exclude isa-app --skip-cache
# Or: npx nx run-many -t test --exclude isa-app --skip-nx-cache
# Run tests for a specific library (always use --skip-cache for fresh results)
npx nx run <project-name>:test --skip-cache
# Example: npx nx run oms-data-access:test --skip-cache
# Run tests for a specific library (always use --skip-nx-cache for fresh results)
npx nx run <project-name>:test --skip-nx-cache
# Example: npx nx run oms-data-access:test --skip-nx-cache
# Skip Nx cache entirely (important for ensuring fresh builds/tests)
npx nx run <project-name>:test --skip-nx-cache
# Or combine with skip-cache: npx nx run <project-name>:test --skip-nx-cache --skip-nx-cache
# Run a single test file
npx nx run <project-name>:test --testFile=<path-to-test-file> --skip-cache
npx nx run <project-name>:test --testFile=<path-to-test-file> --skip-nx-cache
# Run tests with coverage
npx nx run <project-name>:test --code-coverage --skip-cache
npx nx run <project-name>:test --code-coverage --skip-nx-cache
# Run tests in watch mode
npx nx run <project-name>:test --watch
@@ -233,7 +240,8 @@ npx nx affected:test
### Nx Workflow Optimization
- Always use `npx nx run` pattern for executing specific tasks
- Include `--skip-cache` flag when running tests to ensure fresh results
- Include `--skip-nx-cache` flag when running tests to ensure fresh results
- Use `--skip-nx-cache` to bypass Nx cache entirely for guaranteed fresh builds/tests (important for reliability)
- Use affected commands for CI/CD optimization: `npx nx affected:test`
- Visualize project dependencies: `npx nx graph`
- The default git branch is `develop` (not `main`)
@@ -280,13 +288,17 @@ npx nx affected:test
### Performance and Quality Considerations
- **Bundle Monitoring**: Watch bundle sizes (2MB warning, 5MB error for main bundle)
- **Testing Cache**: Always use `--skip-cache` flag when running tests to ensure reliable results
- **Testing Cache**: Always use `--skip-nx-cache` flag when running tests to ensure reliable results
- **Code Quality**: Pre-commit hooks enforce Prettier formatting and ESLint rules automatically
- **Memory Management**: Clean up subscriptions and use OnPush change detection for optimal performance
### Common Troubleshooting
- **Build Issues**: Check Node version and run `npm install` if encountering module resolution errors
- **Test Failures**: Use `--skip-cache` flag and ensure test isolation (no shared state between tests)
- **Test Failures**: Use `--skip-nx-cache` flag and ensure test isolation (no shared state between tests)
- **Nx Cache Issues**: If you see `existing outputs match the cache, left as is` during build or testing:
- **Option 1**: Run `npx nx reset` to clear the Nx cache completely
- **Option 2**: Use `--skip-nx-cache` flag to bypass Nx cache for a specific command (e.g., `npx nx test <project> --skip-nx-cache`)
- **When to use**: Always use `--skip-nx-cache` when you need guaranteed fresh builds or test results
- **SSL Certificates**: Development server uses SSL - accept certificate warnings in browser for localhost
- **Import Errors**: Verify path aliases in `tsconfig.base.json` and use absolute imports for cross-library dependencies