Skip to content

Inspector: Added Extension support and revisions#33200

Merged
sunag merged 4 commits intomrdoob:devfrom
sunag:dev-inspector-extension
Mar 19, 2026
Merged

Inspector: Added Extension support and revisions#33200
sunag merged 4 commits intomrdoob:devfrom
sunag:dev-inspector-extension

Conversation

@sunag
Copy link
Copy Markdown
Collaborator

@sunag sunag commented Mar 18, 2026

Closes #33196
Related: #33165

Description

The PR makes several revisions in order to add support for extensions, and improves the integration of the TSL Graph, which can now be activated through the UI.

Below is a brief guide on how to add an extension.

Inspector - Settings

image

extension.json

You need to make a PR in Three.js to add the extension in extension.json. Here are two examples, one using the library’s own code and another externally.

[
	{
		"name": "TSL Graph",
		"url": "./tsl-graph/TSLGraphEditor.js"
	},
	{
		"name": "My Extension",
		"url": "https://raw.githack.com/sunag/three.js/dev-inspector-hello-world/examples/jsm/inspector/addons/MyExtension.js"
	}
]

MyExtension.js

If the objective is to use it externally, always use three/addons so that, through import maps, you use the same classes used at runtime. If the project has new import maps beyond those added in three.js for compatibility reasons, it will be better to use them through the import() function.

A hello world example:

import { Extension } from 'three/addons/inspector/Extension.js';

class MyExtension extends Extension {

	constructor() {

		super( 'My Extension' );

		const div = document.createElement( 'div' );
		div.textContent = 'Hello World';

		this.content.appendChild( div );

		// center the content
		this.content.style.display = 'grid';
		this.content.style.placeItems = 'center';

	}

}

export default MyExtension;

Result

image

@sunag sunag added this to the r184 milestone Mar 18, 2026
@sunag sunag marked this pull request as ready for review March 18, 2026 05:58
@sunag sunag merged commit 77e9817 into mrdoob:dev Mar 19, 2026
9 checks passed
@sunag sunag deleted the dev-inspector-extension branch March 19, 2026 15:03
@Methuselah96 Methuselah96 mentioned this pull request Mar 20, 2026
47 tasks
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.

Inspector Addons Guidelines

1 participant