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

Examples: Deprecate examples/js scripts #17544

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 2 additions & 0 deletions examples/js/controls/OrbitControls.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
console.warn( 'THREE example script "js/controls/OrbitControls.js" is deprecated and will soon be removed. Use the ES module version instead: "jsm/controls/OrbitControls.js".' );
Copy link
Collaborator

@donmccurdy donmccurdy Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would include the intended date of removal, to force feedback sooner than later, and perhaps reference an issue. Suggestion:

THREE.OrbitControls: Scripts in "examples/js/*" are deprecated and will be removed in January 2020 (r113). Use an ES module instead, "examples/jsm/controls/OrbitControls.js". See: https://github.com/mrdoob/three.js/issues/<TBD>.

^Let's open a new issue to track the change and help users resolve issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good I'll make the change -- @mrdoob it should probably be you who makes the issue to announce the intent to remove and then I can reference that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @mrdoob any plans to make an issue with a deprecation date?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrdoob any updated plans on this?

Copy link
Collaborator

@Mugen87 Mugen87 Jan 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, no files depend in the repository on examples/js anymore. However, it would be good if an additional pair of eyes verifies this^^.

If there are no dependencies anymore, I think we should move on with the removal by adding this log to all js files.

Copy link
Collaborator

@Mugen87 Mugen87 Jan 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also publish a small guide in the docs (maybe an additional section in Import via modules) which explains what users have to do if they used this style:

const THREE = window.THREE = require( 'three' );
require( 'three/examples/js/loaders/GLTFLoader.js' );

or a included the scripts directly:

<script src="https://unpkg.com/[email protected]/build/three.js"></script>
<script src="https://unpkg.com/[email protected]/examples/js/loaders/GLTFLoader.js"></script>

This would make support easier since we can always refer to the same guide.


/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
Expand Down
5 changes: 5 additions & 0 deletions utils/modularize.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ function convert( path, exampleDependencies, ignoreList ) {
var classNames = [];
var coreDependencies = {};

// strip warning

contents = contents.replace( /^\s*console\.warn\(.*?\);\s*/, '' );


// imports

contents = contents.replace( /^\/\*+[^*]*\*+(?:[^/*][^*]*\*+)*\//, function ( match ) {
Expand Down