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

Update deprecation comments clearly stating when deprecated #25643

Merged
merged 8 commits into from
Mar 9, 2023
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
78 changes: 19 additions & 59 deletions src/Three.Legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import { TorusGeometry } from './geometries/TorusGeometry.js';
import { TorusKnotGeometry } from './geometries/TorusKnotGeometry.js';
import { TubeGeometry } from './geometries/TubeGeometry.js';

// r144

export class BoxBufferGeometry extends BoxGeometry {
export class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144

constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) {

Expand All @@ -32,9 +30,7 @@ export class BoxBufferGeometry extends BoxGeometry {

}

// r144

export class CapsuleBufferGeometry extends CapsuleGeometry {
export class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144

constructor( radius, length, capSegments, radialSegments ) {

Expand All @@ -45,9 +41,7 @@ export class CapsuleBufferGeometry extends CapsuleGeometry {

}

// r144

export class CircleBufferGeometry extends CircleGeometry {
export class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144

constructor( radius, segments, thetaStart, thetaLength ) {

Expand All @@ -58,9 +52,7 @@ export class CircleBufferGeometry extends CircleGeometry {

}

// r144

export class ConeBufferGeometry extends ConeGeometry {
export class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144

constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {

Expand All @@ -71,9 +63,7 @@ export class ConeBufferGeometry extends ConeGeometry {

}

// r144

export class CylinderBufferGeometry extends CylinderGeometry {
export class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144

constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {

Expand All @@ -84,9 +74,7 @@ export class CylinderBufferGeometry extends CylinderGeometry {

}

// r144

export class DodecahedronBufferGeometry extends DodecahedronGeometry {
export class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144

constructor( radius, detail ) {

Expand All @@ -97,9 +85,7 @@ export class DodecahedronBufferGeometry extends DodecahedronGeometry {

}

// r144

export class ExtrudeBufferGeometry extends ExtrudeGeometry {
export class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144

constructor( shapes, options ) {

Expand All @@ -110,9 +96,7 @@ export class ExtrudeBufferGeometry extends ExtrudeGeometry {

}

// r144

export class IcosahedronBufferGeometry extends IcosahedronGeometry {
export class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144

constructor( radius, detail ) {

Expand All @@ -123,9 +107,7 @@ export class IcosahedronBufferGeometry extends IcosahedronGeometry {

}

// r144

export class LatheBufferGeometry extends LatheGeometry {
export class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144

constructor( points, segments, phiStart, phiLength ) {

Expand All @@ -136,9 +118,7 @@ export class LatheBufferGeometry extends LatheGeometry {

}

// r144

export class OctahedronBufferGeometry extends OctahedronGeometry {
export class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144

constructor( radius, detail ) {

Expand All @@ -149,9 +129,7 @@ export class OctahedronBufferGeometry extends OctahedronGeometry {

}

// r144

export class PlaneBufferGeometry extends PlaneGeometry {
export class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144

constructor( width, height, widthSegments, heightSegments ) {

Expand All @@ -162,9 +140,7 @@ export class PlaneBufferGeometry extends PlaneGeometry {

}

// r144

export class PolyhedronBufferGeometry extends PolyhedronGeometry {
export class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144

constructor( vertices, indices, radius, detail ) {

Expand All @@ -175,9 +151,7 @@ export class PolyhedronBufferGeometry extends PolyhedronGeometry {

}

// r144

export class RingBufferGeometry extends RingGeometry {
export class RingBufferGeometry extends RingGeometry { // @deprecated, r144

constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {

Expand All @@ -188,9 +162,7 @@ export class RingBufferGeometry extends RingGeometry {

}

// r144

export class ShapeBufferGeometry extends ShapeGeometry {
export class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144

constructor( shapes, curveSegments ) {

Expand All @@ -201,9 +173,7 @@ export class ShapeBufferGeometry extends ShapeGeometry {

}

// r144

export class SphereBufferGeometry extends SphereGeometry {
export class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144

constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {

Expand All @@ -214,9 +184,7 @@ export class SphereBufferGeometry extends SphereGeometry {

}

// r144

export class TetrahedronBufferGeometry extends TetrahedronGeometry {
export class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144

constructor( radius, detail ) {

Expand All @@ -227,9 +195,7 @@ export class TetrahedronBufferGeometry extends TetrahedronGeometry {

}

// r144

export class TorusBufferGeometry extends TorusGeometry {
export class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144

constructor( radius, tube, radialSegments, tubularSegments, arc ) {

Expand All @@ -240,9 +206,7 @@ export class TorusBufferGeometry extends TorusGeometry {

}

// r144

export class TorusKnotBufferGeometry extends TorusKnotGeometry {
export class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144

constructor( radius, tube, tubularSegments, radialSegments, p, q ) {

Expand All @@ -253,9 +217,7 @@ export class TorusKnotBufferGeometry extends TorusKnotGeometry {

}

// r144

export class TubeBufferGeometry extends TubeGeometry {
export class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144

constructor( path, tubularSegments, radius, radialSegments, closed ) {

Expand All @@ -265,5 +227,3 @@ export class TubeBufferGeometry extends TubeGeometry {
}

}


10 changes: 4 additions & 6 deletions src/core/BufferAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,27 +344,25 @@ class BufferAttribute {

}

// @deprecated

copyColorsArray() {
copyColorsArray() { // @deprecated, r144

console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' );

}

copyVector2sArray() {
copyVector2sArray() { // @deprecated, r144

console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' );

}

copyVector3sArray() {
copyVector3sArray() { // @deprecated, r144

console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' );

}

copyVector4sArray() {
copyVector4sArray() { // @deprecated, r144

console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' );

Expand Down
4 changes: 1 addition & 3 deletions src/core/BufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,7 @@ class BufferGeometry extends EventDispatcher {

}

// @deprecated since r144

merge() {
merge() { // @deprecated, r144

console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead.' );
return this;
Expand Down
8 changes: 4 additions & 4 deletions src/math/Triangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ class Triangle {

}

static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) {
static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) { // @deprecated, r151

if ( warnedGetUV === false ) {

console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' ); // @deprecated since r151
console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' );

warnedGetUV = true;

Expand Down Expand Up @@ -199,11 +199,11 @@ class Triangle {

}

getUV( point, uv1, uv2, uv3, target ) {
getUV( point, uv1, uv2, uv3, target ) { // @deprecated, r151

if ( warnedGetUV === false ) {

console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' ); // @deprecated since r151
console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' );

warnedGetUV = true;

Expand Down
4 changes: 1 addition & 3 deletions src/objects/SkinnedMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ class SkinnedMesh extends Mesh {

}

// @deprecated

boneTransform( index, vector ) {
boneTransform( index, vector ) { // @deprecated, r151

console.warn( 'THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151.' );
return this.applyBoneTransform( index, vector );
Expand Down
8 changes: 2 additions & 6 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2288,18 +2288,14 @@ class WebGLRenderer {

}

// @deprecated since r150

get physicallyCorrectLights() {
get physicallyCorrectLights() { // @deprecated, r150

console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
return ! this.useLegacyLights;

}

// @deprecated since r150

set physicallyCorrectLights( value ) {
set physicallyCorrectLights( value ) { // @deprecated, r150

console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
this.useLegacyLights = ! value;
Expand Down
6 changes: 2 additions & 4 deletions src/scenes/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ class Scene extends Object3D {

}

// @deprecated

get autoUpdate() {
get autoUpdate() { // @deprecated, r144

console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
return this.matrixWorldAutoUpdate;

}

set autoUpdate( value ) {
set autoUpdate( value ) { // @deprecated, r144

console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
this.matrixWorldAutoUpdate = value;
Expand Down
4 changes: 2 additions & 2 deletions utils/build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ const builds = [
}
]
},
{
{ // @deprecated, r150
input: 'src/Three.js',
plugins: [
addons(),
Expand All @@ -327,7 +327,7 @@ const builds = [
}
]
},
{
{ // @deprecated, r150
input: 'src/Three.js',
plugins: [
addons(),
Expand Down