Skip to content

Import plugins without creating the global instance - #4158

Open
DmitrySharabin wants to merge 1 commit into
self-registering-languagesfrom
self-registering-plugins
Open

DmitrySharabin wants to merge 1 commit into
self-registering-languagesfrom
self-registering-plugins

Conversation

@DmitrySharabin

@DmitrySharabin DmitrySharabin commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Each plugin adds itself to the registry from #4168 instead of importing global.js. Importing a plugin no longer creates the global instance, and plugins apply in any import order.

<!-- Modules, in any order: Prism comes third here -->
<script type="importmap">
	{ "imports": { "prismjs": "./dist/index.js", "prismjs/": "./dist/" } }
</script>
<script type="module">
	import "prismjs/plugins/line-numbers.js";
	import "prismjs/languages/css.js";
	import "prismjs";
	import "prismjs/languages/javascript.js";
	import "prismjs/plugins/highlight-keywords.js";
</script>
<!-- Classic script: the build loads the plugins from the page settings, or from data-plugins="line-numbers,highlight-keywords" -->
<script>
	window.Prism = { plugins: ["line-numbers", "highlight-keywords"] };
</script>
<script src="dist/prism.js"></script>

🤖 Generated with Claude Code

@DmitrySharabin
DmitrySharabin added this pull request to stack #4159 October 8, 2026 15:57
@netlify

netlify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for dev-prismjs-com ready!

Name Link
🔨 Latest commit a0f8ccc
🔍 Latest deploy log https://app.netlify.com/projects/dev-prismjs-com/deploys/6ad0c9f520c0ce1db1ef771c
😎 Deploy Preview https://deploy-preview-4158--dev-prismjs-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from a0e9d4d to ed6cfb4 Compare October 9, 2026 10:59
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from ed6cfb4 to 802be99 Compare October 9, 2026 11:27
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 802be99 to b0b0ca1 Compare October 9, 2026 11:47
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from b0b0ca1 to 1aea6e4 Compare October 9, 2026 14:04
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 1aea6e4 to b55e0ea Compare October 9, 2026 14:40
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from b55e0ea to ef712b5 Compare October 10, 2026 13:57
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from ef712b5 to c283433 Compare October 10, 2026 16:05
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from c283433 to f74b510 Compare October 10, 2026 17:43
@DmitrySharabin
DmitrySharabin removed this pull request from stack #4159 October 14, 2026 12:11
@DmitrySharabin
DmitrySharabin changed the base branch from self-registering-languages to v2 October 14, 2026 12:11
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from f74b510 to 9e627ed Compare October 14, 2026 12:11
@DmitrySharabin
DmitrySharabin changed the base branch from v2 to self-registering-languages October 14, 2026 12:12
@DmitrySharabin
DmitrySharabin added this pull request to stack #4169 October 14, 2026 12:12
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 9e627ed to 49d8c70 Compare October 14, 2026 12:36
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 49d8c70 to 54087ba Compare October 14, 2026 12:43
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 54087ba to 745b4ac Compare October 14, 2026 12:47
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 745b4ac to 8954395 Compare October 14, 2026 12:49
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 8954395 to 5452786 Compare October 15, 2026 11:10
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 5452786 to 7306d75 Compare October 15, 2026 12:18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DmitrySharabin
DmitrySharabin force-pushed the self-registering-plugins branch from 7306d75 to a0f8ccc Compare October 15, 2026 12:41

This branch has not been deployed

No deployments
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.

1 participant