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

Migrate shaderlab shader #317

Merged

Conversation

zhuxudong
Copy link
Member

@zhuxudong zhuxudong commented Dec 17, 2024

migrate this package to engine

Summary by CodeRabbit

  • New Features

    • All relevant packages have been updated to version 1.4.0-alpha.1, indicating a shift to a pre-release state that may include new features or changes.
  • Bug Fixes

    • Removed export for @galacean/engine-toolkit-shader-lab, which may affect the availability of its functionalities.
  • Documentation

    • The README.md and related documentation files for the ShaderLab-toolkit have been deleted, which may impact user guidance on installation and usage.
  • Chores

    • Several package configuration files have been updated to reflect the new versioning.

@zhuxudong zhuxudong requested a review from GuoLei1990 December 17, 2024 03:43
Copy link

coderabbitai bot commented Dec 17, 2024

Walkthrough

This pull request involves a comprehensive version update across multiple packages within the Galacean Engine Toolkit. The primary change is upgrading the version from 1.3.9 to 1.4.0-alpha.1 for nearly all packages, indicating a pre-release state. Additionally, the @galacean/engine-toolkit-shader-lab package has been completely removed, with its files and exports being deleted from the project.

Changes

File Path Change Summary
packages/*/package.json Version updated from 1.3.9 to 1.4.0-alpha.1 for multiple packages including auxiliary-lines, controls, custom-gltf-parser, custom-material, draco, dynamic-bone, framebuffer-picker, galacean-engine-toolkit, geometry-sketch, gizmo, input-logger, lines, navigation-gizmo, outline, skeleton-viewer, stats, tween, way-point, and xr
packages/galacean-engine-toolkit/src/index.ts Removed export for @galacean/engine-toolkit-shader-lab
packages/shaderlab/* Completely removed package files including README.md, package.json, src/global.d.ts, src/index.ts, src/shaders/*
packages/gizmo/src/Group.ts Minor modification to flag manager access in _applyAdd method

Possibly related PRs

Suggested Reviewers

  • GuoLei1990
  • JujieX

Poem

🐰 A Rabbit's Versioning Tale 🎉

Alpha rises, packages dance light,
Shader lab fades into the night,
Version numbers leap with glee,
A toolkit's journey, wild and free!
Hop along, code's new frontier! 🚀

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3be869b and b171050.

⛔ Files ignored due to path filters (20)
  • packages/custom-material/src/advanced-shader/thinfilm/IridescenceIndirectLight.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/BlendShape.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/Common.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/Fog.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/Light.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/Normal.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/Shadow.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/ShadowSampleTent.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/Skin.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/Transform.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/AttributesPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/BRDF.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/ForwardPassPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/FragmentPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/LightDirectPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/LightIndirectPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/LightProbe.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/ReflectionLobe.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/VaryingsPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/VertexPBR.glsl is excluded by !**/*.glsl
📒 Files selected for processing (29)
  • packages/auxiliary-lines/package.json (1 hunks)
  • packages/controls/package.json (1 hunks)
  • packages/custom-gltf-parser/package.json (1 hunks)
  • packages/custom-material/package.json (1 hunks)
  • packages/draco/package.json (1 hunks)
  • packages/dynamic-bone/package.json (1 hunks)
  • packages/framebuffer-picker/package.json (1 hunks)
  • packages/galacean-engine-toolkit/package.json (1 hunks)
  • packages/galacean-engine-toolkit/src/index.ts (0 hunks)
  • packages/geometry-sketch/package.json (1 hunks)
  • packages/gizmo/package.json (1 hunks)
  • packages/gizmo/src/Group.ts (1 hunks)
  • packages/input-logger/package.json (1 hunks)
  • packages/lines/package.json (1 hunks)
  • packages/navigation-gizmo/package.json (1 hunks)
  • packages/outline/package.json (1 hunks)
  • packages/shaderlab/README.md (0 hunks)
  • packages/shaderlab/package.json (0 hunks)
  • packages/shaderlab/src/global.d.ts (0 hunks)
  • packages/shaderlab/src/index.ts (0 hunks)
  • packages/shaderlab/src/shaders/PBR.gs (0 hunks)
  • packages/shaderlab/src/shaders/index.ts (0 hunks)
  • packages/shaderlab/src/shaders/shadingPBR/index.ts (0 hunks)
  • packages/shaderlab/tsconfig.json (0 hunks)
  • packages/skeleton-viewer/package.json (1 hunks)
  • packages/stats/package.json (1 hunks)
  • packages/tween/package.json (1 hunks)
  • packages/way-point/package.json (1 hunks)
  • packages/xr/package.json (1 hunks)
💤 Files with no reviewable changes (9)
  • packages/galacean-engine-toolkit/src/index.ts
  • packages/shaderlab/tsconfig.json
  • packages/shaderlab/src/global.d.ts
  • packages/shaderlab/src/shaders/shadingPBR/index.ts
  • packages/shaderlab/src/shaders/PBR.gs
  • packages/shaderlab/README.md
  • packages/shaderlab/package.json
  • packages/shaderlab/src/index.ts
  • packages/shaderlab/src/shaders/index.ts
✅ Files skipped from review due to trivial changes (19)
  • packages/gizmo/package.json
  • packages/tween/package.json
  • packages/controls/package.json
  • packages/way-point/package.json
  • packages/lines/package.json
  • packages/input-logger/package.json
  • packages/galacean-engine-toolkit/package.json
  • packages/outline/package.json
  • packages/custom-gltf-parser/package.json
  • packages/auxiliary-lines/package.json
  • packages/geometry-sketch/package.json
  • packages/custom-material/package.json
  • packages/xr/package.json
  • packages/dynamic-bone/package.json
  • packages/draco/package.json
  • packages/skeleton-viewer/package.json
  • packages/navigation-gizmo/package.json
  • packages/stats/package.json
  • packages/framebuffer-picker/package.json

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@zhuxudong zhuxudong changed the base branch from main to dev/1.4 December 17, 2024 03:43
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/gizmo/src/Group.ts (1)

222-225: Consider improving type safety

The @ts-ignore comment suggests that _updateFlagManager might not be properly typed on the Entity interface. Consider:

  1. Adding proper type definitions for _updateFlagManager on the Entity type
  2. Using a type guard if this is an internal implementation detail

Example type definition:

interface Entity {
  // ... existing properties
  _updateFlagManager: UpdateFlagManager; // Add appropriate type
}
🛑 Comments failed to post (1)
packages/gizmo/src/Group.ts (1)

223-223: 💡 Codebase verification

API change appears to be inconsistent with current engine version

The evidence suggests this change is problematic:

  • The package depends on engine version ^1.3.0-beta.6
  • No other occurrences of direct _updateFlagManager access were found in the codebase
  • The change moves from transform._updateFlagManager to entity._updateFlagManager without corresponding engine version upgrade

This change appears premature or incorrect as it's modifying the API access pattern while still depending on an older engine version that likely doesn't support this new pattern.

🔗 Analysis chain

Verify API compatibility with engine repository

The change moves _updateFlagManager access from entity.transform to entity directly. This appears to be a breaking change that might be related to internal refactoring in the engine repository.

Let's verify the API change consistency:

Consider adding documentation about this breaking change in the changelog, especially since this is part of a version upgrade to 1.4.0-alpha.1. The documentation should explain:

  • The rationale behind moving _updateFlagManager to the entity level
  • Migration steps for consumers of this API

Let me gather more context about the entity and transform types to better understand this API change.


Let me check the package dependencies and version constraints to understand if this is part of a coordinated update with the engine.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other usages of _updateFlagManager in the codebase
# to ensure consistent access patterns

# Search for transform._updateFlagManager pattern
echo "Checking for old pattern usage:"
rg "transform\._updateFlagManager"

# Search for direct _updateFlagManager access
echo -e "\nChecking for new pattern usage:"
rg "\._updateFlagManager" --type ts

Length of output: 305


Script:

#!/bin/bash
# Search for Entity class definition and its properties
echo "Searching for Entity class definition:"
ast-grep --pattern 'class Entity {
  $$$
}'

# Search for Transform class definition
echo -e "\nSearching for Transform class definition:"
ast-grep --pattern 'class Transform {
  $$$
}'

# Search for imports of Entity/Transform in Group.ts
echo -e "\nChecking imports in Group.ts:"
rg "import.*Entity|import.*Transform" packages/gizmo/src/Group.ts

Length of output: 524


Script:

#!/bin/bash
# Check package.json for engine dependency version
echo "Checking engine dependency version:"
fd package.json --exec cat {} | jq -r 'select(.dependencies."@galacean/engine" != null) | .dependencies."@galacean/engine"'

# Check if there are any migration guides or changelogs
echo -e "\nSearching for migration guides or changelogs:"
fd -i -g '*changelog*' -g '*migration*' -g '*upgrade*'

# Check commit message for version upgrade context
echo -e "\nChecking commit message for version context:"
git log -n 1 --pretty=format:"%B" packages/gizmo/src/Group.ts

Length of output: 660

# Conflicts:
#	packages/shaderlab/package.json
@cptbtptpbcptdtptp cptbtptpbcptdtptp merged commit bbb2f88 into galacean:dev/1.4 Dec 17, 2024
1 check failed
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