Skip to content

Conversation

davidtaylorhq
Copy link
Member

In the near future, runtime resolution of components via the ember resolver will no longer be possible. This commit introduces a dedicated list of Right Sidebar Blocks components, and allows other themes/plugins to register additional ones.

This also avoids the issue of normal component names clashing with rsb block names, so specific handling of cases like custom-html-rsb is no longer necessary.

Other themes/plugins can register new blocks via the new right-sidebar-blocks value transformer

api.registerValueTransformer(
  "right-sidebar-blocks",
  ({ value: blocks }) => blocks.set("my-amazing-block", MyAmazingBlock)
);

For now, resolution of components via the Ember resolver is still supported, but will print a deprecation message to the console with upgrade instructions.

In the near future, runtime resolution of components via the ember resolver will no longer be possible. This commit introduces a dedicated list of Right Sidebar Blocks components, and allows other themes/plugins to register additional ones.

This also avoids the issue of normal component names clashing with rsb block names, so specific handling of cases like `custom-html-rsb` is no longer necessary.

Other themes/plugins can register new blocks via the new `right-sidebar-blocks` value transformer

```js
api.registerValueTransformer(
  "right-sidebar-blocks",
  ({ value: blocks }) => blocks.set("my-amazing-block", MyAmazingBlock)
);
```

For now, resolution of components via the Ember resolver is still supported, but will print a deprecation message to the console with upgrade instructions.
@merefield
Copy link

@davidtaylorhq wouldn't it make sense to make this more generic in naming? e.g. "sidebar-blocks" or "widget-blocks" or some such? The assumption of location might not be the best long term?

@davidtaylorhq
Copy link
Member Author

davidtaylorhq commented Jun 16, 2025

@merefield yeah that's fair, although I do want to make it very clear that this API is purely for this theme component. So if we just go for sidebar-blocks, then we should probably rename this theme component to discourse-sidebar-blocks at the same time.

@davidtaylorhq davidtaylorhq marked this pull request as draft June 16, 2025 15:43
@merefield
Copy link

@davidtaylorhq ok I think I'll leave you to make your local decisions here and we can discuss the broader challenge on meta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants