Is your feature request related to a problem? Please describe.
packages/framework/src/modules/cms/cms.service.ts defines 36+ abstract methods, one per block type. Adding a new block forces changes in both CmsService and every integration (mocked, Strapi, Contentful), even when an integration does not support that block.
Consequences:
- The mocked CMS service is 255+ lines of mapper dispatching
- Strapi and Contentful must implement methods for blocks they may not use
- Violates the open-closed principle — the framework class changes whenever a new block is added
Describe the solution you'd like
Introduce a single generic method instead of the many block-specific ones:
export abstract class CmsService {
// Core methods stay
abstract getAppConfig(options: GetCmsAppConfigParams): Observable<AppConfig>;
abstract getPage(options: GetCmsPageParams): Observable<Page | undefined>;
abstract getPages(options: GetCmsPagesParams): Observable<Page[]>;
abstract getHeader(options: GetCmsHeaderParams): Observable<Header>;
abstract getFooter(options: GetCmsEntryParams): Observable<Footer>;
// Single generic method replaces 30+ block-specific ones
abstract getBlockConfig<T>(options: GetCmsBlockConfigParams): Observable<T>;
}
// Usage in block service:
const config = this.cmsService.getBlockConfig<TicketListBlock.TicketListBlock>({
id: query.id,
locale: headers['x-locale'],
blockType: 'TicketListBlock', // used by integration to dispatch
});
Adding a new block would then only require a new mapper in the integration, without changing the framework interface.
Additional context (if applicable)
- Key file:
packages/framework/src/modules/cms/cms.service.ts
- Rationale: High priority because it may be relatively easy to implement and would significantly improve this service.
This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting /reward 100 (replace 100 with the amount).
🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment /try to let everyone know!
🙌 And when they open the PR, they can comment /claim #758 either in the PR description or in a PR's comment.
🪙 Also, everyone can tip any user commenting /tip 20 @lukasz-hycom (replace 20 with the amount, and @lukasz-hycom with the user to tip).
📖 If you want to learn more, check out our documentation.
Is your feature request related to a problem? Please describe.
packages/framework/src/modules/cms/cms.service.tsdefines 36+ abstract methods, one per block type. Adding a new block forces changes in bothCmsServiceand every integration (mocked, Strapi, Contentful), even when an integration does not support that block.Consequences:
Describe the solution you'd like
Introduce a single generic method instead of the many block-specific ones:
Adding a new block would then only require a new mapper in the integration, without changing the framework interface.
Additional context (if applicable)
packages/framework/src/modules/cms/cms.service.tsThis repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting
/reward 100(replace100with the amount).🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment
/tryto let everyone know!🙌 And when they open the PR, they can comment
/claim #758either in the PR description or in a PR's comment.🪙 Also, everyone can tip any user commenting
/tip 20 @lukasz-hycom(replace20with the amount, and@lukasz-hycomwith the user to tip).📖 If you want to learn more, check out our documentation.