Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Next.js] XMC Forms support without BYOC #2052

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

illiakovalenko
Copy link
Contributor

@illiakovalenko illiakovalenko commented Mar 12, 2025

  • This PR follows the Contribution Guide
  • Changelog updated (Will update once it's fully reviewed)
  • Upgrade guide entry added (Will update once it's fully reviewed)

Description / Motivation

Core

  • Introduced framework-agnostic Form utilities to enable shared logic across different implementations.

React Form

  • Introduced a new non byoc Form component.
  • Updated SitecoreContext to support a global api configuration. This is currently necessary for the Form component to perform requests.

Angular Form

  • Applied previously missing styles and RenderingIdentifier parameters.
  • Simplified implementation by reusing the Form functionality from the sitecore-jss package.

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

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 on lines +44 to +49
api={{
edge: {
contextId: config.sitecoreEdgeContextId,
edgeUrl: config.sitecoreEdgeUrl,
},
}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a new file because of this portion

@@ -14,6 +14,10 @@ const monorepoPlugin = (nextConfig = {}) => {
'./node_modules/@sitecore-feaas/clientside/dist/browser/react.esm.js'
);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Workaround for "monorepo" setup, since we need to reference the same package

@illiakovalenko illiakovalenko requested a review from a team March 12, 2025 13:02
Copy link
Contributor

@art-alexeyenko art-alexeyenko left a comment

Choose a reason for hiding this comment

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

This is well thought out, considering the limitations of double SXP/XMC requirement.
I only have one concern over worst-case scenario and logging around it, please see my comment

if (isEditing) {
if (error) {
return (
<div className="sc-jss-placeholder-error">There was a problem loading this section</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add some guidance to this message, i.e.
"There was a problem loading this section. Check debug logs for sitecore-jss:form for more details"
Or perhaps we can log the caught error in console? While debug log will have entries from loadForm exceptions, user won't know what happened if somehow context.api.edge is undefined.

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.

2 participants