Skip to content

Commit a44c98f

Browse files
Copilothotlong
andcommitted
Fix code review feedback: update docs, fix indentation, improve comments
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 88aaee3 commit a44c98f

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

examples/crm-app/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@ The application bootstraps in `src/main.tsx`:
7575
```typescript
7676
async function bootstrap() {
7777
// 1. Start MSW Mock Server (Critical: Must be first)
78-
if (process.env.NODE_ENV === 'development') {
79-
console.log('🛑 Bootstrapping Mock Server...');
80-
await startMockServer();
81-
}
78+
console.log('🛑 Bootstrapping Mock Server...');
79+
await startMockServer();
8280

8381
// 2. Initialize Clients (Must happen AFTER MSW is ready)
8482
console.log('🔌 Connecting Clients...');
@@ -93,7 +91,10 @@ async function bootstrap() {
9391
);
9492
}
9593

96-
bootstrap();
94+
bootstrap().catch(err => {
95+
console.error("FATAL: Application failed to start", err);
96+
document.body.innerHTML = `<div style="color:red; padding: 20px;"><h1>Application Error</h1><pre>${err.message}</pre></div>`;
97+
});
9798
```
9899

99100
### 3. Client Connection

examples/crm-app/src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ async function bootstrap() {
3333
}
3434

3535
bootstrap().catch(err => {
36-
console.error("FATAL: Application failed to start", err);
37-
document.body.innerHTML = `<div style="color:red; padding: 20px;"><h1>Application Error</h1><pre>${err.message}</pre></div>`;
36+
console.error("FATAL: Application failed to start", err);
37+
document.body.innerHTML = `<div style="color:red; padding: 20px;"><h1>Application Error</h1><pre>${err.message}</pre></div>`;
3838
});

examples/crm-app/vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ export default defineConfig(({ mode }) => ({
4141
transformMixedEsModules: true
4242
},
4343
rollupOptions: {
44+
// Suppress warnings for optional dynamic imports in runtime
4445
onwarn(warning, warn) {
45-
// Suppress warnings for optional dynamic imports
46+
// Ignore unresolved import warnings for @objectstack/driver-memory
47+
// This is an optional fallback dynamic import in the runtime kernel.
48+
// It's safe to suppress because the driver is explicitly imported in src/mocks/browser.ts
4649
if (
4750
warning.code === 'UNRESOLVED_IMPORT' &&
4851
warning.message.includes('@objectstack/driver-memory')

0 commit comments

Comments
 (0)