Skip to content

Usage of Docusaurus theme-common/internal #1140

Open
@slorber

Description

@slorber

Describe the bug

This plugin has usage of @docusaurus/theme-common/internal APIs that we may refactor in minor versions.

It actually happens in practice, as the CodeBlock theme components were refactored for Docusaurus v3.8

I'm restoring the former internal methods you are using to keep retro-compatibility: facebook/docusaurus#11153

But will remove these APIs in Docusaurus v4.

Expected behavior

Plugins shouldn't use internal APIs, or they risk locking their users to a specific Docusaurus version

Current behavior

Usage of internal APIs

Possible solution

For v4, it will be needed to refactor the existing theme code. Hopefully, it should help reduce the code you maintain.

Let me know if you need help doing so when the time comes.

Context

I've noticed this issue when upgrading to canary a large site using your plugin.

sailpoint-oss/developer.sailpoint.com#811

Rspack would emit various warnings in build logs:

Warning: {"message":" ⚠ ESModulesLinkingWarning: export 'containsLineNumbers' (imported as 'containsLineNumbers') was not found in '@docusaurus/theme-common/internal'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions