Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Feb 18, 2025
2 parents e943b3e + 9c93436 commit 07da976
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions demo/site/cache-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,9 @@ export default class CacheHandler {
}
fallbackCache.set(key, value, { size: stringData.length });
}

async revalidateTag(tags: string | string[]): Promise<void> {
if (tags.length === 0) return;
console.warn("CacheHandler.revalidateTag", tags);
}
}
28 changes: 28 additions & 0 deletions docs/docs/2-core-concepts/7-dependencies/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,34 @@ You must recreate the block index views after
You can automate this process by following the steps in the [migration guide](/docs/migration-guide/migration-from-v5-to-v6/#block-index).
For new projects, it should already be automated.

### Providing dependency information

If your block depends on certain entities, you should provide dependency information.
You can do that using the `indexData()` method in your block data class like this:

```ts
class MyCustomBlockData extends BlockData {
// ...

indexData(): BlockIndexData {
if (this.damFileId === undefined) {
return {};
}

return {
dependencies: [
{
targetEntityName: DamFile.name,
id: this.damFileId,
},
],
};
}
}
```

This works for all entities - not just `DamFile`.

### Displaying dependencies in the admin interface

Next, you probably want to display the dependencies or dependents (usages) of an entity in the admin interface.
Expand Down

0 comments on commit 07da976

Please sign in to comment.