Conversation
… switch to ESM modules Please note: cache tag functionality has been rewritten and is now available as a separate export: @smartive/datocms-utils/cache. The new implementation supports multiple backends, including Redis and Postgres, and is designed to be more flexible and extensible. Please refer to the updated documentation for details on how to use the new cache functionality.
|
🎉 This PR is included in version 3.0.0-next.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.0.0-next.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.0.0-next.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.0.0-next.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.0.0-next.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Pull request overview
This PR introduces version 3 of the @smartive/datocms-utils package with significant architectural changes. The update modernizes the module system, refactors cache tag management into a provider pattern, and adds support for multiple storage backends.
Changes:
- Migrates to ES modules with Node.js's
nodenextmodule resolution and adds.jsextensions to all relative imports - Refactors cache tag functionality from function-based to class-based provider pattern with three implementations: Redis, Neon (Postgres), and Noop
- Removes hard dependency on
@vercel/postgres, making storage backends optional peer dependencies - Introduces package subpath exports for tree-shakeable imports of specific providers
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Updates module system to use nodenext for both module and moduleResolution |
| package.json | Adds subpath exports for providers, moves dependencies to optional peer dependencies, adds build cleanup scripts |
| src/types.ts | Deleted - types moved to src/cache-tags/types.ts |
| src/cache-tags.ts | Deleted - replaced by provider pattern in src/cache-tags/provider/neon.ts |
| src/cache-tags-redis.ts | Deleted - replaced by src/cache-tags/provider/redis.ts |
| src/index.ts | Removes cache-tags and types exports, adds .js extensions to imports |
| src/classnames.ts | Enhances to filter empty strings and accept numbers, improving type safety |
| src/cache-tags/types.ts | New file with cache tag types and CacheTagsProvider interface |
| src/cache-tags/utils.ts | New file with utility functions (moved from deleted files) |
| src/cache-tags/provider/redis.ts | New Redis provider implementation using class-based pattern |
| src/cache-tags/provider/neon.ts | New Neon (Postgres) provider as replacement for Vercel Postgres |
| src/cache-tags/provider/noop.ts | New no-op provider for testing/development |
| src/cache-tags/index.ts | New barrel export for cache-tags module |
| README.md | Complete documentation rewrite with examples for all providers |
| .releaserc.json | Adds support for pre-release on next branch |
| .github/workflows/release.yml | Adds next branch to release workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@mfeltscher I've opened a new pull request, #214, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
🎉 This PR is included in version 3.0.0-next.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 17 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mfeltscher I've opened a new pull request, #215, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…214) * Initial plan * Fix SQL injection vulnerability in Neon provider table name Co-authored-by: mfeltscher <1352744+mfeltscher@users.noreply.github.com> * Improve identifier validation and escape double quotes Co-authored-by: mfeltscher <1352744+mfeltscher@users.noreply.github.com> * Improve error message to clarify schema-qualified names Co-authored-by: mfeltscher <1352744+mfeltscher@users.noreply.github.com> * schoener --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mfeltscher <1352744+mfeltscher@users.noreply.github.com> Co-authored-by: Moreno Feltscher <moreno@smartive.ch>
|
🎉 This PR is included in version 3.0.0-next.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 17 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
🎉 This PR is included in version 3.0.0-next.12 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* feat: make error handling of cache tags providers configurable * fix: adjust default * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * erroooooor * errorrrrrs * fix: guard onError callback to prevent masking provider errors (#218) * Initial plan * fix: wrap onError callback in try-catch to prevent masking original errors Co-authored-by: mfeltscher <1352744+mfeltscher@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mfeltscher <1352744+mfeltscher@users.noreply.github.com> Co-authored-by: Moreno Feltscher <moreno@smartive.ch> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: mfeltscher <1352744+mfeltscher@users.noreply.github.com>
|
🎉 This PR is included in version 3.0.0-next.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.0.0-next.14 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.