Skip to content

Conversation

@marklundin
Copy link
Collaborator

This PR adds deprecation warning for the legacy <OrbitControls/> component in favour of the newer CameraControls from the engine.

The component is still included but will be removed in future versions

- Introduced a static property `scriptName` to the `NullScript` class for better identification.
- Added a deprecation warning in the `OrbitControls` component, advising users to switch to `CameraControls` for future compatibility.
@marklundin marklundin self-assigned this Oct 28, 2025
@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

🦋 Changeset detected

Latest commit: 74f9503

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@playcanvas/react Patch
@playcanvas/blocks Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@marklundin marklundin requested a review from Copilot October 28, 2025 14:29
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 28, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@playcanvas/blocks@280
npm i https://pkg.pr.new/@playcanvas/react@280

commit: 74f9503

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR deprecates the legacy <OrbitControls/> component in favor of the newer CameraControls from the PlayCanvas engine. A deprecation warning has been added to inform users of the change, though the component remains functional for backward compatibility.

  • Adds a deprecation warning to <OrbitControls/> using warnOnce utility
  • Fixes NullScript class by adding missing scriptName static property
  • Includes changeset documentation for the deprecation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/lib/src/scripts/orbit-controls/index.tsx Adds deprecation warning to OrbitControls component
packages/lib/src/components/Script.tsx Adds scriptName property to NullScript class
.changeset/large-carpets-post.md Documents the deprecation change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marklundin marklundin requested a review from a team October 28, 2025 14:30
@marklundin marklundin changed the title Deprecates orbit controls Add deprecation warning for <OrbitControls/> Oct 28, 2025
@marklundin marklundin merged commit 86f01de into main Oct 30, 2025
6 checks passed
@marklundin marklundin deleted the deprecate-orbit-controls branch October 30, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants