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

fix multipalyer clone issue at runtime #1039

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/@dcl/inspector/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@dcl/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@dcl/inspector",
"version": "0.1.0",
"dependencies": {
"@dcl/asset-packs": "^2.0.0",
"@dcl/asset-packs": "^2.1.1",
"ts-deepmerge": "^7.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@dcl/sdk-commands/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 4 additions & 15 deletions packages/@dcl/sdk-commands/src/logic/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,14 @@ import { compositeFromLoader } from '~sdk/all-composites'
${
isEditorScene &&
`
import { initAssetPacks } from '@dcl/asset-packs/dist/scene-entrypoint'
initAssetPacks(engine)
import { syncEntity } from '@dcl/sdk/network'
import { initAssetPacks, setSyncEntity } from '@dcl/asset-packs/dist/scene-entrypoint'
initAssetPacks(engine, { syncEntity })

// TODO: do we need to do this on runtime ?
// I think we have that information at build-time and we avoid to do evaluate this on the worker.
// Read composite.json or main.crdt => If that file has a NetowrkEntity import '@dcl/@sdk/network'

// conditionally load networking code if the NetworkEntity component is being used...
for (const path in compositeFromLoader) {
const composite = compositeProvider.getCompositeOrNull(path)
if (composite) {
const { components } = composite.composite
const hasNetworkEntity = components.find(($) => $.name === NetworkEntity.componentName)
if (hasNetworkEntity) {
import('@dcl/sdk/network')
}
}
}`
`
}

if ((entrypoint as any).main !== undefined) {
Expand All @@ -106,7 +96,6 @@ export * from '${unixEntrypointPath}'

export async function bundleProject(components: BundleComponents, options: CompileOptions, sceneJson: Scene) {
const tsconfig = path.join(options.workingDirectory, 'tsconfig.json')

/* istanbul ignore if */
if (!options.single && !sceneJson.main) {
throw new CliError('scene.json .main must be present')
Expand Down
Loading