Skip to content

Support#36281

Open
nicobytes wants to merge 5 commits into
mainfrom
support
Open

Support#36281
nicobytes wants to merge 5 commits into
mainfrom
support

Conversation

@nicobytes

Copy link
Copy Markdown
Member

This pull request introduces significant improvements to the documentation, configuration, and usage guidance for the @dotcms/experiments SDK, especially in the context of Next.js integration. It also includes updates to example environment files, gitignore, and Docker compose scripts for better developer experience and reliability.

Documentation and Usage Improvements:

  • Major rewrite and expansion of the core-web/libs/sdk/experiments/README.md:

    • Clearly documents the public API, emphasizing that only withExperiments is public and that internal providers should not be imported directly. [1] [2]
    • Provides explicit, safe usage patterns for Next.js App Router, including canonical examples and anti-patterns to avoid React hooks errors and UVE crashes.
    • Adds troubleshooting guidance for common integration issues and clarifies support channels.
    • Updates configuration best practices, stressing the importance of environment variables, version alignment, and correct server origin usage.
  • Updates JSDoc for DotExperimentsProvider to mark it as internal and discourage direct usage, reinforcing the intended public API.

Next.js Example Project Enhancements:

  • Adds a comprehensive .env.local.example for the Next.js analytics/experiments example, detailing all required environment variables and their purpose.
  • Introduces a .gitignore tailored for Next.js projects, covering dependencies, build artifacts, environment files, and debugging logs.
  • Adds AGENTS.md and CLAUDE.md with agent-specific instructions and references for the example project. [1] [2]

DevOps and Tooling Reliability:

  • Improves Docker compose script compatibility by supporting both docker compose (v2 plugin) and legacy docker-compose, and uses the correct command for listing running services. [1] [2]

Build and Configuration Cleanup:

  • Removes the unused primeng entry from .cursor/mcp.json and formats the angular-cli command arguments for clarity.

These changes collectively make the SDK easier to use correctly, improve developer onboarding, and reduce the risk of common integration pitfalls.

…alytics and experiments integration

## Summary

Introduces a new example project demonstrating the integration of dotCMS Content Analytics and A/B Experiments using Next.js. This example features a minimal headless setup with separated integration for analytics and experiments.

## Changes

- Created a new directory `examples/nextjs-analytics-experiments` containing:
  - Configuration files (`package.json`, `tsconfig.json`, etc.)
  - Environment variable example (`.env.local.example`)
  - Core components and pages for handling analytics and experiments
  - Utility functions for fetching dotCMS pages and handling responses
  - Basic styling with Tailwind CSS

## Verification

Run the example with `npm install` and `npm run dev` to start the local server.

Closes #36200

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…ing integration

## Summary

Enhances documentation for the `@dotcms/experiments` SDK and related examples, providing clearer guidance on A/B testing integration with Next.js.

## Changes

- Added sections on Public API, Troubleshooting, and Anti-patterns in `core-web/libs/sdk/experiments/README.md`.
- Updated example files to clarify the separation of analytics and experiments, emphasizing the importance of unconditionally calling `withExperiments`.
- Improved descriptions in `examples/nextjs/README.md` and `examples/nextjs-analytics-experiments/README.md` to guide users on best practices for using the SDK.

## Verification

Review the updated documentation and examples to ensure clarity and correctness.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@github-actions

Copy link
Copy Markdown
Contributor

❌ Issue Linking Required

This PR could not be linked to an issue. All PRs must be linked to an issue for tracking purposes.

How to fix this:

Option 1: Add keyword to PR body (Recommended - auto-removes this comment)
Edit this PR description and add one of these lines:

  • This PR fixes #123 or Fixes: #123

  • This PR closes #123 or Closes: #123

  • This PR resolves #123 or Resolves: #123

  • Other supported keywords: fix, fixed, close, closed, resolve, resolved
    Option 2: Link via GitHub UI (Note: won't clear the failed check)

  1. Go to the PR → Development section (right sidebar)

  2. Click "Link issue" and select an existing issue

  3. Push a new commit or re-run the workflow to clear the failed check
    Option 3: Use branch naming
    Create a new branch with one of these patterns:

  • 123-feature-description (number at start)

  • issue-123-feature-description (issue-number at start)

  • feature-issue-123 (issue-number anywhere)

Why is this required?

Issue linking ensures proper tracking, documentation, and helps maintain project history. It connects your code changes to the problem they solve.---

This comment was automatically generated by the issue linking workflow

@github-actions github-actions Bot added Area : Frontend PR changes Angular/TypeScript frontend code Area : SDK PR changes SDK libraries labels Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

🤖 Bedrock Review — deepseek.v3.2

No issues found in the diff.


Run: #28041383514 · tokens: in: 29840 · out: 8 · total: 29848

@claude

claude Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Claude finished @nicobytes's task in 1m 16s —— View job


Rollback Safety Analysis

  • Read rollback-unsafe categories reference
  • Get full PR diff
  • Analyze diff against all unsafe categories
  • Apply appropriate label

Result: ✅ Safe To Rollback

All changes in this PR are documentation, examples, and DevOps tooling — none fall into any rollback-unsafe category.

Changes reviewed:

File(s) Nature Unsafe category?
core-web/libs/sdk/experiments/README.md Documentation rewrite None
core-web/libs/sdk/experiments/src/lib/components/DotExperimentsProvider.tsx JSDoc cleanup (marks component as @internal) — no logic change None
docker/docker-compose-examples/experiments/start-experiments.sh Shell script: adds docker compose v2 plugin fallback, fixes ps command None
.cursor/mcp.json Config cleanup (removes unused primeng entry) None
examples/nextjs-analytics-experiments/** New example project (Next.js app, .env.local.example, .gitignore, README) None
examples/nextjs/CLAUDE.md, examples/nextjs/README.md Minor documentation updates None

No database migrations, no Elasticsearch mapping changes, no REST/GraphQL API contract changes, no content model changes, no OSGi interface changes, and no VTL viewtool contract changes are present.

Label AI: Safe To Rollback has been applied.

Comment thread .cursor/mcp.json
"nx-mcp@latest"
]
},
"primeng": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

because is dead, not working, I guess.

@nicobytes

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	core-web/libs/sdk/experiments/README.md

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved. I merged main into this branch and fixed the README conflict in commit 27d11507.

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

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code Area : SDK PR changes SDK libraries

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants