question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make Release Version More Obvious in Build Output

See original GitHub issue

Is your feature request related to a problem? Please describe.

Currently in the build output (e.g. three.js), there’s no way to tell what the version of three.js is.

EDIT: Currently in the build output (e.g. three.js), it’s not immediately obvious what the release version or “revision” is.

Describe the solution you’d like

I would like to see some version information included at the top of the source file.

// threejs.org/license
// version: 0.125.2
(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
        ...

For example, we could reference version in package.json at the time of the build.

An example proposal would be in utils/build/rollup.config.js:

import pkg from "../../package.json";

...

function header() {

	return {

		renderChunk( code ) {

			return (
                             '// threejs.org/license\n' +
                             `// version: ${pkg.version}\n` +
                             code
                        );

		}

	};

}

Describe alternatives you’ve considered

We could potentially use information from git like the latest tag or commit hash.

There may be a Rollup plugin we can include for this purpose: https://www.npmjs.com/package/rollup-plugin-version-injector

The point is to include some indication of the version in the build output .js file.

Any thoughts on this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
gbroquescommented, Feb 13, 2021

Changing the position of the mentioned line in the build file is problematic since you normally have no control how the build tool merges your code together. And since the build config is already complex, I do not vote to change something to accommodate this issue.

You have 125 results when you are searching for version in build/three.js (in contrast to 6 when searching for revision). So I’m not sure if adding a comment will provide much benefit.

Have you considered to install three.js developer tools in your browser? When you enable the tool in the browser’s dev tools, it shows you the used three.js version in the console.

image

That is super handy! I had no idea this existed.

Thank you again for you helpfulness!

How about add such as export const VERSION = REVISION; as an alias at constants.js line 2?

@gonnavis This seems reasonable, but I’m not very concerned with it. I do appreciate your input here as well!

For context, I’m completely new to Three.js, but I wouldn’t look for the version to be re-defined by a source code variable. I searched for “r125” originally in the file, and failed to search for “125”.

I’m more than satisfied with the responses and help from @Mugen87. 😃

Feel free to re-open if anyone wants more discussion.

0reactions
gonnaviscommented, Feb 14, 2021

Hello @Mugen87 , thank you for reminding me of this plug-in, I remember that there is a way to automatically print out REVISION, but I can’t recall it.

I currently have no difficulty finding the version number from the THREE.REVISION or source code. But I think as a newcomer, will probably look for VERSION instead of REVISION, and should not know the existence of three.js developer tools, at least that’s how I was at the beginning.

How about add such as export const VERSION = REVISION; as an alias at constants.js line 2?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add an option to output the version that would be published
The simple one is to provide a cli option to instruct semantic release to just print the version. For example semantic-release --print-next- ...
Read more >
How to change the build type to Release mode in cmake?
I am setting the variable CMAKE_BUILD_TYPE to "Release" in CMakeLists.txt . But it is still building the project in debug mode. When I...
Read more >
Surviving the Release Version - CodeProject
One thing you can do is turn off all the optimizations in the release version. Go to the Project | Settings for the...
Read more >
Visual Studio: Copying files to Debug or Release folder
If the file in the build folder is needed then first, create a copy of the file before changing Copy to Output Directory...
Read more >
Versioned Documentation - Read the Docs
If your project has any tags or branches with a name following semantic versioning, we also create a stable version, tracking your most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found