pmndrs / three-stdlib

📚 Stand-alone library of threejs examples designed to run without transpilation in node & browser
https://npmjs.com/three-stdlib
MIT License
733 stars 119 forks source link

fix: BufferGeometry rename uv2 to uv1 #377

Closed RodrigoHamuy closed 4 months ago

RodrigoHamuy commented 4 months ago

uv2 has been renamed to uv1 in threejs:

codesandbox-ci[bot] commented 4 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

CodyJasonBennett commented 4 months ago

We'll need to perform some indirection here for the key to preserve backward compatibility. Had a tough time maintaining this with the back-to-back renames between versions.

https://github.com/pmndrs/three-stdlib/blob/d89e3c32a1eb97e9415e2c361e18af081bc66a25/src/loaders/GLTFLoader.js#L1753-L1770

RodrigoHamuy commented 4 months ago

@CodyJasonBennett I think is not a terrible idea to ask users to update to a newer ThreeJS version that is more than a year old anyway in exchange of cleaner code.

But if you disagree, will update the files to follow the same strategy as GLTFLoader.js for backward compatiliby.

CodyJasonBennett commented 4 months ago

The goal of this project is to make itself obsolete by fostering improvements to three examples, and upstreaming them, but we have the additional constraint of adhering to SemVer (which I personally think is an oversight) which means we have to employ tricks to maintain compatibility.

Requiring an upgrade to three.js is a breaking change (major version increment), and I think we can try to maintain an indirection table until that becomes infeasible. The need for an upgrade to three.js is a larger conversation than the changes in this PR alone, as we support as low as r128 with many breaking changes to public API and types since.

CodyJasonBennett commented 4 months ago

I can do this myself in a few hours, when I can take a closer look.

RodrigoHamuy commented 4 months ago

I can do this myself in a few hours, when I can take a closer look.

No worries, makes sense, will push in a few minutes.

RodrigoHamuy commented 4 months ago

@CodyJasonBennett backward compatibility added ☺️

CodyJasonBennett commented 4 months ago

Thanks; I appreciate the thoroughness. Elevating to a fix so we can get this out.

github-actions[bot] commented 4 months ago

:tada: This PR is included in version 2.32.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: