Skip to content

fix(upgrade): correct more of what real 1.x extensions' upgrades got wrong - #68

Merged
imorland merged 6 commits into
3.xfrom
im/upgrade-ambient-module-exports
Oct 17, 2026
Merged

imorland merged 6 commits into
3.xfrom
im/upgrade-ambient-module-exports

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes: no issue.

Changes proposed in this pull request:
More of what real 1.x extensions' upgrades got wrong, one commit each:

  • TypeScript that exports from an ambient declare module block failed to parse, which stopped the formatting, admin and misc steps.
  • ext: imports: every reference to an extension's module is rewritten, in export … from, import(), require() and declare module too. The tsconfig keeps the path where the 1.x mapping found the extension's typings.
  • A method assigned to a lazy module's prototype became an extend() that never replaced it. It is now an override().
  • A new extender went into every array extend.php returns, including a Conditional's. It now goes only into the outermost one.
  • Search: a class 1.x registered as both a gambit and a filter is now registered once, and only constrain()'s query parameter becomes an Eloquent builder. A key-value gambit gets its hint translation and a @TODO to write it.
  • flarum-webpack-config ^3.0.7 (fix(webpack-config): register a default exported expression as its value framework#5234) for upgraded and new extensions.

Reviewers should focus on:

  • src/utils/babel-ts.ts: Recast's parser with Babel's undeclared-export check turned off. Other parse errors still fail the step.

Screenshot
N/A

Necessity

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

Confirmed

  • Frontend changes: tested on a local Flarum installation. (N/A, CLI.)
  • Frontend changes: tests are green (run yarn test in js/).
  • Frontend changes: tests have been added, or are not appropriate here.
  • Backend changes: tests are green (run composer test). (N/A)
  • Backend changes: tests have been added, or are not appropriate here. (N/A)
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite). (N/A)
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

@imorland
imorland marked this pull request as ready for review October 17, 2026 12:47
@imorland
imorland merged commit 8690223 into 3.x Oct 17, 2026
3 checks passed
@imorland
imorland deleted the im/upgrade-ambient-module-exports branch October 17, 2026 12:47
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