flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.39k stars 834 forks source link

[1.x] [extensibility] Export all missing modules in compat #4044

Closed DavideIadeluca closed 1 month ago

DavideIadeluca commented 2 months ago

Fixes https://github.com/flarum/framework/pull/4006#issuecomment-2380559537

Changes proposed in this pull request:

Reviewers should focus on:

Screenshot

QA

  1. Try to extend/override a newly added component from core
  2. Try to extend/override a newly added component from an extension
  3. Try to use a newly added util which is the default export (i.e. fireDebugWarning)
  4. Try to use a newly added util which is a non default export (i.e. fireDeprecationWarning)

Necessity

Confirmed

Required changes:

SychO9 commented 2 months ago

@DavideIadeluca for 2.x you don't actually need to do anything 👍

In 2.x every module used by the code (core and extensions) is accessible by other extensions. Unless the module is declared but not used (which is not the case currently).

DavideIadeluca commented 2 months ago

@DavideIadeluca for 2.x you don't actually need to do anything 👍

In 2.x every module used by the code (core and extensions) is accessible by other extensions. Unless the module is declared but not used (which is not the case currently).

@SychO9 Yeah I was also of the same understanding per the diary you shared on discuss. But I'm kind of confused now what the usage is for the newly added forum.ts files in core and extensions?

https://github.com/flarum/framework/blob/da441c77caae7688a39099a2b9c39b1c40cc9604/framework/core/js/src/forum/forum.ts#L1-L53

https://github.com/flarum/framework/blob/da441c77caae7688a39099a2b9c39b1c40cc9604/extensions/flags/js/src/forum/forum.ts#L1-L10

SychO9 commented 2 months ago

@DavideIadeluca those are mostly the result of automatically converting the old compat files. A lot of the imports there are redundant and add nothing. However because we now lazy load certain components, those files serve as a way to ensure certain components are not lazy loaded, without having to constantly check where they are used.

We'll probably remove those (forum.ts, common.ts, admin.ts) files for the bundled extensions before 2.0 is out.