8000 docs(isr): add version compatibility table by maxisam · Pull Request #1794 · rx-angular/rx-angular · GitHub
[go: up one dir, main page]

Skip to content

docs(isr): add version compatibility table #1794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions libs/isr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ A library that enables Angular Universal applications to generate static pages a
npm install @rx-angular/isr
```

## Version Compatibility

| RxAngular | Angular |
| --------- | --------- |
| `^18.0.0` | `^18.0.0` |
| `^17.1.0` | `^17.0.0` |
| `^16.0.0` | `^16.0.0` |

## How to use it?

1. Initialize `ISRHandler` inside `server.ts`
Expand All @@ -37,10 +45,7 @@ const isr = new ISRHandler({

```ts
server.use(express.json());
server.post(
'/api/invalidate',
async (req, res) => await isr.invalidate(req, res)
);
server.post('/api/invalidate', async (req, res) => await isr.invalidate(req, res));
```

3. Replace Angular default server side rendering with ISR rendering
Expand All @@ -64,7 +69,7 @@ server.get(
// Serve page if it exists in cache
async (req, res, next) => await isr.serveFromCache(req, res, next),
// Server side render the page and add to cache if needed
async (req, res, next) => await isr.render(req, res, next)
async (req, res, next) => await isr.render(req, res, next),
);
```

Expand All @@ -80,7 +85,7 @@ server.get(
{ provide: CUSTOM_TOKEN, useValue: 'Hello from ISR' },
CustomService,
],
})
}),
);
```

Expand All @@ -105,7 +110,7 @@ server.get(
modifyGeneratedHtml: (req, html) => {
return `${html}<!-- Hello, I'm modifying the generatedHtml before caching it! -->`;
},
})
}),
);
```

Expand Down
Loading
0