Skip to content

[nextjs] Secured variants generation for server components in Design Studio#369

Merged
yavorsk merged 21 commits intodevfrom
feature/JSS-8846
Feb 19, 2026
Merged

[nextjs] Secured variants generation for server components in Design Studio#369
yavorsk merged 21 commits intodevfrom
feature/JSS-8846

Conversation

@yavorsk
Copy link
Copy Markdown
Contributor

@yavorsk yavorsk commented Feb 17, 2026

Description / Motivation

This PR enables and extends Design Studio's component generation features for server components in NexttJs app router application.

  • enables variant generation mode for server components;
  • now the application does not accept the generated code from design studio directly, via message event. Instead it makes a secured request to an endpoint where the generated component data is stored;
  • introduce separate default imports for server and client components for NextJs app router application
  • refactoring: separate server actions and models for component update and component preview to make flow more comprehensible

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate) - Design Studio with App router app and server side components

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Comment thread packages/content/src/editing/codegen/preview.ts Dismissed
Comment thread packages/content/src/editing/codegen/preview.ts Dismissed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 17, 2026

📦 Package Size and Test Coverage Report

Package Base Size PR Size Δ Change Base Coverage PR Coverage Δ Change
analytics-core 122.52 KB 122.52 KB ✅ 0.00 KB 100.00% 100.00% 0.00%
cli 58.70 KB 58.70 KB ✅ 0.00 KB 69.73% 69.73% 0.00%
content 416.55 KB 421.23 KB 🔺 +4.68 KB 92.05% 92.10% +0.05%
core 102.67 KB 102.67 KB ✅ 0.00 KB 92.76% 92.76% 0.00%
create-content-sdk-app 280.71 KB 280.71 KB ✅ 0.00 KB 96.22% 96.22% 0.00%
events 76.91 KB 76.91 KB ✅ 0.00 KB 98.40% 98.40% 0.00%
nextjs 430.77 KB 438.02 KB 🔺 +7.25 KB 89.76% 89.36% -0.41%
personalize 63.45 KB 63.45 KB ✅ 0.00 KB 99.32% 99.32% 0.00%
react 288.02 KB 294.08 KB 🔺 +6.06 KB 93.85% 93.23% -0.62%
search 7.30 KB 7.30 KB ✅ 0.00 KB 98.57% 98.57% 0.00%
Total 🔺 +17.99 KB

@illiakovalenko illiakovalenko changed the title [core] [react] [nextjs] Variant generation for server components in Design Studio follow up [core] [react] [nextjs] Secured Variant generation for server components in Design Studio Feb 18, 2026
@illiakovalenko illiakovalenko changed the title [core] [react] [nextjs] Secured Variant generation for server components in Design Studio [nextjs] Secured variants generation for server components in Design Studio Feb 18, 2026
Copy link
Copy Markdown
Collaborator

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Please see suggestions below for further refinement

Comment thread packages/content/src/editing/codegen/preview.ts Outdated
Comment thread packages/content/src/editing/codegen/preview.ts Outdated
Comment thread packages/content/src/editing/codegen/preview.ts Outdated
Comment thread packages/content/src/editing/codegen/preview.ts Outdated
Comment thread packages/nextjs/src/editing/codegen/import-map-server.ts Outdated
Comment thread packages/react/src/components/DesignLibrary/DesignLibraryClientEvents.tsx Outdated
Comment thread packages/react/src/server-actions/update-server-component-action.ts Outdated
Comment thread packages/react/src/server-actions/update-server-component-action.ts
@illiakovalenko
Copy link
Copy Markdown
Collaborator

@yavorsk Please, update Changelog as well

Copy link
Copy Markdown
Collaborator

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Please, see some suggestions below based on our discussion
Once all comments are addressed and everything is resolved, feel free to proceed with the merge.

Comment thread packages/react/src/server-actions/update-server-component-action.ts Outdated
Comment thread packages/react/src/server-actions/update-server-component-action.ts Outdated
Comment thread packages/react/src/server-actions/update-server-component-action.ts
Comment thread packages/react/src/server-actions/update-server-component-action.ts
Comment thread packages/react/src/server-actions/update-server-component-action.ts Outdated
Comment thread packages/react/src/components/DesignLibrary/DesignLibraryClientEvents.tsx Outdated
Comment thread packages/react/src/components/DesignLibrary/DesignLibraryClientEvents.tsx Outdated
Comment thread CHANGELOG.md Outdated
@yavorsk yavorsk merged commit 93fb409 into dev Feb 19, 2026
6 checks passed
@yavorsk yavorsk deleted the feature/JSS-8846 branch February 19, 2026 16:16
yavorsk added a commit that referenced this pull request Feb 20, 2026
…Studio (#369)

* DL status event now has isRenderingServerComponent property

* remove the error sent for temporarily unavailable variant generation mode

* update types in variant generation mode; update server function to fetch component data from secured endpoint in variant generation mode; enabled variant generation mode; update unit tests

* server side default import map for app router

* update api surface

* few comment updates

* include CdpHelper in import-map-server

* update component actions and unit tests

* updates to design library server components

* update log messages

* update changelog

* fix constant name

* fix lint error

* update api extractor

* rename updatedComponentRendering to rendering

* rename previewEventArgs and make it required

* rename error prop

* rename

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants