Closed cptbtptpbcptdtptp closed 2 days ago
The recent updates enhance the flexibility of component creation within the Entity
and XRManagerExtended
classes. The addComponent
method in the Entity
class now supports additional arguments for component instantiation, allowing more dynamic and flexible component creation. Similarly, the addFeature
method in XRManagerExtended
now returns a more specific instance type, improving type safety and clarity.
File | Change Summary |
---|---|
packages/core/src/Entity.ts | Updated the addComponent method to accept additional arguments for component instantiation, enhancing flexibility in component creation. |
packages/xr/src/XRManagerExtended.ts | Updated the addFeature method to return InstanceType<T> instead of XRFeature , improving type safety and specificity. |
sequenceDiagram
participant User
participant Entity
participant Component
User->>Entity: addComponent(ComponentType, ...args)
Entity->>Component: new ComponentType(Entity, ...args)
Component-->>Entity: Component instance
Entity-->>User: Component instance
sequenceDiagram
participant User
participant XRManagerExtended
participant XRFeature
User->>XRManagerExtended: addFeature(FeatureType)
XRManagerExtended->>XRFeature: new FeatureType()
XRFeature-->>XRManagerExtended: Feature instance
XRManagerExtended-->>User: Feature instance
In the land of Entity and XR's domain,
Flexibility and type safety reign.
Components tailored, features bright,
Each line of code now feels just right.
With every method clear and true,
Here's to the changes—cheers from me to you! 🐰✨
[!TIP]
AI model upgrade
## `gpt-4o` model for reviews and chat is now live OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide any feedback or to report any issues.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
You can:
Summary by CodeRabbit
addComponent
method in theEntity
class for improved flexibility in component creation.addFeature
method in theXRManagerExtended
class to return more specific instance types, enhancing type safety and usability.