r

playcanvas / react

You can copy the badge and add it to your README!

Continuous Releases from main
chore: update versions (#281) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>5 days ago9063838
fix(deps): update all npm dependencies (#288) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>5 days ago7bebda9
chore(deps): upgrade vitest to version 4.0.8 and update related dependencies (#289)5 days ago9fcd712
fix(deps): update all npm dependencies (#287) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>6 days agoc146e21
chore(deps): update mscharley/dependency-changesets-action action to v1.2.1 (#285) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>6 days agofb030d1
Improved GLTF API (#282) * feat(gltf-scene): introduce GLTF Scene Modification API and related components - Added a new GLTF Scene Modification API, including components like GltfScene, Modify, and hooks for entity management. - Implemented context for managing GLTF scene state and hierarchy. - Introduced examples demonstrating the usage of the new API for modifying GLTF assets. - Updated existing components (Camera, Light, Render) to export their definitions for better integration with the new API. - Added type definitions for improved TypeScript support. This commit enhances the library's capabilities for declarative modifications of GLTF assets, providing a more flexible and powerful way to manage 3D scenes. * feat: add new <Gltf/> API for enhanced 3D scene management * refactor(gltf): restructure GLTF API and introduce new components - Moved GLTF scene management to a dedicated API, enhancing modularity and usability. - Introduced new components: Gltf, Modify, and associated hooks for improved entity manipulation. - Updated type definitions and context management for better integration and TypeScript support. - Added examples demonstrating the new API's capabilities for modifying GLTF assets. - Removed deprecated components and streamlined the overall structure for clarity. This commit significantly enhances the library's functionality for declarative modifications of GLTF assets, providing a more robust framework for 3D scene management. * Improve tests * fix(gltf): enhance Gltf component and integration tests - Updated the Gltf component to include a check for the parent entity in the useEffect hook, improving asset instantiation logic. - Refactored integration tests to improve clarity and coverage, including modifications to existing component props and handling of edge cases. - Adjusted test assertions to ensure proper state before and after modifications, enhancing reliability of test outcomes. - Improved the structure of test cases for better readability and maintainability. * refactor(gltf): enhance integration tests with new test components - Introduced a new file containing test component fixtures to streamline integration tests for the Gltf component. - Replaced direct Gltf usage in tests with specific test components to improve clarity and maintainability. - Updated various test cases to utilize the new components, demonstrating different GLTF modification patterns. - Enhanced the overall structure of integration tests for better readability and organization. * add warnings tests * feat(gltf): add warnings for adding existing components to entities - Enhanced the RuleProcessor component to check for existing components on entities before adding new ones. - Introduced a warning mechanism to inform users when attempting to add a component that already exists, guiding them to use modification actions instead. - Updated tests to reflect changes in component handling and ensure proper functionality. * Fixed entity cast * updated changeset * Update packages/lib/src/gltf/examples.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor(gltf): update rule merging logic to use MODIFY_COMPONENT action - Changed instances of REMOVE_COMPONENT to MODIFY_COMPONENT in rule merging tests to reflect updated action handling. - Enhanced test cases to ensure proper functionality of component modifications, including the addition of props for removal. - Improved clarity and maintainability of tests by aligning with the new action structure. * refactor(tests): enhance rule merging tests for clarity and accuracy - Updated assertions in the rule merging test to explicitly check the winning rule's ID, action type, and properties. - Improved test readability by assigning the winning action to a variable for clearer context. - Ensured that the tests accurately reflect the expected behavior of the merging logic with the MODIFY_COMPONENT action. * Update packages/lib/src/gltf/components/Gltf.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor(gltf): optimize child clearing logic in RuleProcessor component - Improved efficiency of child clearing by using a Map for O(1) lookups of current children by GUID. - Updated the logic to find original children, enhancing performance and clarity of the code. - Ensured that the functionality remains intact while streamlining the process of managing entity children. * fix(gltf): correct import extension and add useEntity tests - Updated the import of useParent from '.ts' to '.tsx' for consistency. - Introduced comprehensive tests for the useEntity hook, covering various path matching scenarios, wildcard usage, and predicate functions. - Enhanced test coverage to ensure accurate entity retrieval and handling of edge cases. * fix(gltf): resolve entity component duplication warnings - Implemented logic in the RuleProcessor to prevent adding duplicate components to entities. - Added warning messages to inform users when attempting to add an existing component, promoting the use of modification actions. - Updated tests to verify the new warning functionality and ensure correct handling of component additions. * test(gltf): add comprehensive tests for functional prop updates - Introduced multiple test cases to validate the behavior of functional updates for light and render components. - Ensured correct handling of various scenarios, including undefined values, boolean toggles, and zero values. - Enhanced test coverage for the Modify component to verify the integration of functional updates with direct prop modifications. * Update .changeset/stale-pandas-fetch.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(gltf): enhance useEntity hook with PathMatcher for improved entity retrieval - Integrated PathMatcher into the useEntity hook to support consistent path matching, including component filters and wildcards. - Updated the logic for finding entities by pattern, allowing for more flexible and efficient entity searches. - Added comprehensive tests to validate the new functionality, ensuring correct behavior with various path patterns and component filters. * refactor(gltf): improve useEntity hook for enhanced entity retrieval - Refactored the useEntity hook to streamline entity matching logic, ensuring consistent handling of string paths and predicate functions. - Updated return logic to handle wildcards and predicates more effectively, returning arrays or null as appropriate. - Enhanced traversal methods in helper functions to build relative paths correctly, improving the accuracy of entity searches. * Update packages/lib/src/gltf/components/Gltf.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * linting fix * refactor(gltf): remove unused exports from index files - Removed unused exports PathMatcher and defaultPathMatcher from gltf/index.ts to streamline the module. - Cleaned up index.ts by eliminating the unused useEntity export, improving code clarity and maintainability. * Update packages/lib/src/gltf/components/RuleProcessor.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/lib/src/Application.test.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/lib/src/gltf/hooks/use-entity.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore(gltf): remove COVERAGE_ANALYSIS.md file - Deleted the COVERAGE_ANALYSIS.md file as it is no longer needed for tracking test coverage analysis for the GLTF module. - This cleanup helps streamline the documentation and focuses on more relevant resources. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>last weeke800b2e
fix(deps): update all npm dependencies (#283) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>last weekc623176
Exclude incompatible Application props from component schema (#279) * refactor: update component definition API to use options object - Changed the component definition function to accept an options object, allowing for exclusion of specific props and defining an API name. - Updated multiple components to utilize the new options structure for better clarity and maintainability. - Adjusted the applyProps function to accept a more generic props type. * refactor: expand excluded props in Application component - Added 'gamepads', 'scene', 'scripts', and 'assets' to the list of excluded props in the Application component. - Updated the corresponding exclude array to reflect these changes for improved prop management. * changeset2 weeks ago131b07d