This repository is an Adobe Edge Delivery Services (EDS) project that combines:
- standard EDS blocks under
blocks/ - React-powered interactive blocks under
react/src/blocks/ - Universal Editor (UE) component models under
blocks/*/_*.jsonandmodels/
Use this guide to understand how code is organized and how to safely add new blocks/components.
Copilot guidance for this repo lives in .github/copilot-instructions.md.
AI Agent guidance for this repo lives in AGENTS.md.
- Preview:
https://main--eds-react--rightpoint.aem.page/ - Live:
https://main--eds-react--rightpoint.aem.live/
blocks/
<block-name>/
<block-name>.js # EDS block loader/decorator
<block-name>.css # EDS block styles
_<block-name>.json # UE model definition for the block
utils/
grouped-block-config.js # Shared grouped-row parsing helpers
react/
src/
blocks/
<block-name>/
index.tsx # React mount/unmount entry for Vite
<Block>.tsx # React UI implementation
<block-name>.css # Block-scoped styles
components/
<component-name>/
<Component>.tsx # Component implementation
<Component>.css # Component styles
index.tsx # Export for clean imports
dist/
<block-name>/<block-name>.js
<block-name>/<block-name>.css
shared/*.js # Shared runtime/chunks (must be committed)
models/
_component-definition.json
_component-models.json
_component-filters.json
_section.json
component-definition.json # generated from models/
component-models.json # generated from models/
component-filters.json # generated from models/
- EDS executes
blocks/<name>/<name>.jswhen a block is found on the page. - That loader parses authored block rows and dynamically imports the React bundle from
react/distusing:new URL(..., import.meta.url)- dynamic
import()
- The React entry (
react/src/blocks/<name>/index.tsx) exportsmount()/unmount()and renders into the block root. - Shared React chunks are emitted to
react/dist/shared/.
- UE grouping is used to keep logical cell counts manageable for
xwalk/max-cells. - Block HTML does not include model key names; parsing depends on row and value order.
- Grouped parsing is centralized in
blocks/utils/grouped-block-config.js.
For grouped blocks:
- Define
GROUPED_FIELD_KEYSin the block script. - Keep array order aligned to authored UE row order.
- Parse with
readGroupedBlockProperties(block, GROUPED_FIELD_KEYS).
npm install
cd react && npm installnpm run react:dev
npm run lint:js
npm run lint:css
npm run build:json
npm run react:buildRecommended pre-merge validation:
npm run lint:js
npm run lint:css
npm run build:json
npm run react:build- Create EDS files:
blocks/<name>/<name>.jsblocks/<name>/<name>.css
- Create UE model:
blocks/<name>/_<name>.json
- Create React files:
react/src/blocks/<name>/index.tsxreact/src/blocks/<name>/<Component>.tsx
- Register entry in
react/vite.config.ts(blockEntries). - Add
<name>tomodels/_section.jsonfilters. - Regenerate component JSON:
npm run build:json
- Build React output:
npm run react:build
- Commit source + generated files together:
blocks/...react/src/...react/dist/...component-*.json