Skip to content

Commit c18a4fd

Browse files
authored
Merge pull request #1166 from decentraland/sync/main-into-experimental
sync: main into experimental (manual rebase)
2 parents 9ef869d + d635d44 commit c18a4fd

65 files changed

Lines changed: 3301 additions & 933 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Sync main to experimental
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Configure Git
23+
run: |
24+
git config user.name "github-actions[bot]"
25+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
27+
- name: Sync main into experimental branch
28+
run: |
29+
# Always use the same rolling branch
30+
BRANCH_NAME="chore/sync"
31+
git checkout -B $BRANCH_NAME origin/experimental
32+
33+
# Pull main changes into experimental branch
34+
git pull origin main
35+
36+
git checkout --theirs .
37+
git add -A .
38+
39+
# Run required update steps
40+
make update-protocol 'experimental'
41+
make install
42+
make build
43+
make update-snapshots
44+
45+
# Add updated files
46+
git add -A .
47+
48+
# Commit if there are changes
49+
git commit --no-edit || echo "No changes to commit"
50+
51+
# Push (force to keep PR updated)
52+
git push --force --set-upstream origin $BRANCH_NAME
53+
54+
- name: Create or update PR
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
run: |
58+
PR_NUMBER=$(gh pr list --base experimental --head chore/sync --state open --json number --jq '.[0].number')
59+
60+
if [ -n "$PR_NUMBER" ]; then
61+
echo "PR #$PR_NUMBER already exists, adding comment..."
62+
gh pr comment $PR_NUMBER --body "🔄 Updated with latest changes from **main** on $(date -u '+%Y-%m-%d %H:%M UTC')"
63+
else
64+
echo "Creating new PR..."
65+
gh pr create \
66+
--base experimental \
67+
--head chore/sync \
68+
--title "chore: sync main to experimental" \
69+
--body ":crown: *Automated PR to keep experimental in sync with main (with protocol updates, build & snapshots)*" \
70+
--label "auto-pr"

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
77
"dependencies": {
88
"@actions/core": "^1.10.0",
9-
"@dcl/protocol": "1.0.0-16079712278.commit-7b0267f",
9+
"@dcl/protocol": "1.0.0-16429465125.commit-bac58dd",
1010
"@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1",
1111
"@dcl/ts-proto": "1.153.0",
1212
"@types/fs-extra": "^9.0.12",

packages/@dcl/inspector/jest.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ module.exports = isE2E ? {
3232
}
3333
},
3434
collectCoverageFrom: ["src/**/*.ts"],
35-
coveragePathIgnorePatterns: ["node_modules/", "src/lib/babylon/decentraland/gizmo-patch.ts"],
3635
verbose: true,
37-
testPathIgnorePatterns: ["e2e"],
36+
testPathIgnorePatterns: ["e2e"],
3837
testMatch: ["**/*.spec.(ts)"],
3938
testEnvironment: "jsdom",
4039
transformIgnorePatterns: [
4140
`/node_modules/(?!(@babylonjs)|(@dcl/ecs-math)|(@dcl/asset-packs)|(@dcl/sdk)|(@dcl/ecs)|(@dcl-sdk/utils))`,
4241
],
4342
setupFiles: ['./test/setup.ts']
4443
}
45-

packages/@dcl/inspector/package-lock.json

Lines changed: 47 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@dcl/inspector/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"name": "@dcl/inspector",
33
"version": "0.1.0",
44
"dependencies": {
5-
"@dcl/asset-packs": "2.5.1",
5+
"@dcl/asset-packs": "2.5.2",
66
"ts-deepmerge": "^7.0.0"
77
},
88
"devDependencies": {
9-
"@babylonjs/core": "~6.18.0",
10-
"@babylonjs/gui": "~6.18.0",
11-
"@babylonjs/inspector": "~6.18.0",
12-
"@babylonjs/loaders": "~6.18.0",
13-
"@babylonjs/materials": "~6.18.0",
9+
"@babylonjs/core": "8.7.0",
10+
"@babylonjs/gui": "8.7.0",
11+
"@babylonjs/inspector": "8.7.0",
12+
"@babylonjs/loaders": "8.7.0",
13+
"@babylonjs/materials": "8.7.0",
1414
"@dcl/ecs": "file:../ecs",
1515
"@dcl/ecs-math": "2.1.0",
1616
"@dcl/mini-rpc": "^1.0.7",

packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ActionInspector.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { useArrayState } from '../../../hooks/useArrayState'
2222
import { analytics, Event } from '../../../lib/logic/analytics'
2323
import { EditorComponentsTypes } from '../../../lib/sdk/components'
2424
import { getAssetByModel } from '../../../lib/logic/catalog'
25+
import { updateGltfForEntity } from '../../../lib/babylon/decentraland/sdkComponents/gltf-container'
2526

2627
import { Block } from '../../Block'
2728
import { Container } from '../../Container'
@@ -127,6 +128,7 @@ export default withSdk<Props>(({ sdk, entity: entityId }) => {
127128
const hasStates = useHasComponent(entityId, States)
128129
const hasCounter = useHasComponent(entityId, Counter)
129130
const hasRewards = useHasComponent(entityId, Rewards)
131+
const [gltfValue] = useComponentValue(entityId, sdk.components.GltfContainer)
130132

131133
useChange(
132134
(event, sdk) => {
@@ -143,15 +145,27 @@ export default withSdk<Props>(({ sdk, entity: entityId }) => {
143145
)
144146

145147
useEffect(() => {
146-
if (entity) {
148+
if (entity && gltfValue) {
149+
const currentGltfSrc = entity.ecsComponentValues.gltfContainer?.src
150+
const isChangingGltf = currentGltfSrc !== gltfValue.src
151+
152+
if (isChangingGltf) {
153+
entity.resetGltfAssetContainerLoading()
154+
}
155+
156+
updateGltfForEntity(entity, gltfValue)
147157
entity
148158
.onGltfContainerLoaded()
149159
.then((gltfAssetContainer) => {
150160
setAnimations([...gltfAssetContainer.animationGroups])
151161
})
152-
.catch(() => {})
162+
.catch(() => {
163+
setAnimations([])
164+
})
165+
} else {
166+
setAnimations([])
153167
}
154-
}, [entity])
168+
}, [entity, gltfValue])
155169

156170
const isValidAction = useCallback(
157171
(action: Action) => {
@@ -295,7 +309,7 @@ export default withSdk<Props>(({ sdk, entity: entityId }) => {
295309
const handleRemove = useCallback(async () => {
296310
sdk.operations.removeComponent(entityId, Actions)
297311
await sdk.operations.dispatch()
298-
const gltfContainer = getComponentValue(entityId, GltfContainer)
312+
const gltfContainer = getComponentValue(entityId, sdk.components.GltfContainer)
299313
const asset = getAssetByModel(gltfContainer.src)
300314
analytics.track(Event.REMOVE_COMPONENT, {
301315
componentName: ComponentName.ACTIONS,

0 commit comments

Comments
 (0)