Skip to content

Remove use of defaultValue #672

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

Merged
merged 1 commit into from
Jun 2, 2025
Merged

Remove use of defaultValue #672

merged 1 commit into from
Jun 2, 2025

Conversation

javagl
Copy link
Contributor

@javagl javagl commented May 31, 2025

I'll open this despite the open question of What's the future of gltf-pipeline? (or rather, to prevent the short-term answer to that "being broken"):

The defaultValue function has been deprecated in CesiumJS, and is scheduled for removal in a few months. The gltf-pipeline library is stil used in several projects (with one of them being CesiumJS itself...). This PR removes the use of defaultValue throughout the codebase, and replaces it with the nullish coalescing operator.

(Note: This will likely cause merge conflicts with #669 . Depending on the timeline, we will have to fix the defaultValue deprecation first. In doubt, it should probably be possible to create a "replace-all"-regex for the changes here. I just did them manually, because they have just so been below the threshold where an automation seemed worthwhile, but that's subjective).

@lilleyse
Copy link
Contributor

lilleyse commented Jun 2, 2025

Thanks @javagl. We'll need to publish a new version of gltf-pipeline as well, right?

@lilleyse lilleyse merged commit a434f0b into main Jun 2, 2025
2 checks passed
@javagl
Copy link
Contributor Author

javagl commented Jun 2, 2025

There are still the unknowns around #670

Given the interconnection between CesiumJS and gltf-pipeline, the concept of "versions" (or even "semantic versioning") don't have so much meaning here. Right now, users might declare
"cesium": "^1.103.0",
"gltf-pipeline": "^4.1.0",
(as, for example, in the 3d-tiles-tools). The gltf-pipeline itself declares
"cesium": "^1.86.1",
I think that this will cause trouble when Cesium 1.134 comes out (without defaultValue). And there will be further steps necessary to actually prevent this trouble. But I think that what has been done in this PR will be necessary, regardless of the exact further steps that will be taken.

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