Skip to content

[2.x] fix: register Input in the common export manifest - #4929

Merged
imorland merged 1 commit into
2.xfrom
im/eagerly-register-input
Aug 12, 2026
Merged

[2.x] fix: register Input in the common export manifest#4929
imorland merged 1 commit into
2.xfrom
im/eagerly-register-input

Conversation

@imorland

Copy link
Copy Markdown
Member

Changes proposed in this pull request:

Input is public extension API — documented attrs, shipped typings — but it was never listed in common.ts, the manifest that eagerly registers components with the export registry. It only reached the forum bundle incidentally, because AbstractGlobalSearch imported it statically.

#4909 replaced that <Input> with a plain button and dropped the import. That leaves the lazily-loaded SearchModal as the only forum-side importer, so webpack moved Input into the SearchModal chunk — in the built forum.js it now appears only as addChunkModule, never reg.add.

Extensions resolve core components synchronously via reg.get(), which returns undefined for a chunk-only module. So any extension rendering flarum/common/components/Input throws "The selector must be either a string or a component" on first render — fof/ui-kit's DiscussionSearch is one, which breaks fof/move-posts. It recovers only once something else loads the search modal chunk.

Adding Input to common.ts restores the eager registration.

Reviewers should focus on:

Whether other public components are in the same position. Bundle membership is an emergent property of which modules core happens to import statically, so any refactor that removes core's last eager import silently demotes a public component to chunk-only — no build error, no type error, just undefined at runtime in downstream extensions. A test asserting the documented public surface is reg.add'd in the built bundles would catch the next one; happy to follow up with that separately if wanted.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Frontend changes: tests are green (run yarn test in js/).
  • Frontend changes: tests have been added, or are not appropriate here.
  • The description above is written by me and describes what this pull request actually does.

Input is public extension API but was never listed in common.ts, the
manifest that eagerly registers components with the export registry. It
reached the forum bundle only incidentally, via AbstractGlobalSearch's
static import.

#4909 replaced that Input with a plain button and dropped the import,
leaving the lazily-loaded SearchModal as its only forum-side importer.
Webpack therefore moved Input into the SearchModal chunk, where it is
registered with addChunkModule instead of reg.add.

Extensions resolve core components synchronously through reg.get, which
returns undefined for a chunk-only module, so any extension rendering
flarum/common/components/Input throws until something else loads the
search modal chunk.
@imorland
imorland requested a review from a team as a code owner August 12, 2026 16:10
@imorland imorland changed the title fix: register Input in the common export manifest [2.x] fix: register Input in the common export manifest Aug 12, 2026
@imorland imorland added this to the 2.0.0-rc.6 milestone Aug 12, 2026
@imorland
imorland merged commit 305be6a into 2.x Aug 12, 2026
25 checks passed
@imorland
imorland deleted the im/eagerly-register-input branch August 12, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant