2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-04 01:15:08 +08:00
discourse/config/initializers
David Taylor af3385baba
DEV: Introduce new rollup-based plugin build system (#35477)
This commit introduces a new build system for plugins, which shares a
large amount of code with the recently-modernized theme compiler.
Plugins are compiled to native ES Modules, and loaded using native
`import()` in the browser, just like themes.

To achieve inter-plugin imports, each bundled plugin entrypoint
implements a custom 'module federation' interface. Each export from
internal plugin modules is made available as a specially-named export on
the entrypoint. When modules in another plugin's namespace are imported,
they are automatically rewritten to use these federated entrypoints.

This change should be almost 100% backwards-compatible. There are some
edge cases which will behave differently, since modules are now eagerly
evaluated according to the ESM spec, instead of being lazily required
via asynchronous-module-definitions (AMD).

The native ESM format should also provide a performance improvement. The
old AMD system involved lots of nested function calls when booting the
app. Now, all the source modules are bundled up into a single ESM bundle
with minimal stack depth.

The build system implements a filesystem-based cache. That means that if
the plugin javascript files are unchanged, they will not need to be
recompiled, even after restarting the Rails server. This mimics the
behaviour of the theme system. Similarly, in production builds, existing
files will be automatically reused if they exist. In future, we plan to
include pre-built copies of common plugins in our prebuild-asset
bundles.

Initially, this new compiler is disabled by default. To test it, we can
set the `ROLLUP_PLUGIN_COMPILER=1` environment variable. We'll continue
to test, improve and document the system before enabling it by default.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: Chris Manson <chris@manson.ie>
2026-03-03 13:50:55 +00:00
..
000-active_record.rb DEV: Add ai_posts_embeddings to ignored tables (#36629) 2025-12-12 12:58:57 +00:00
000-development_reload_warnings.rb DEV: prevent files being watched warning when using devenv (#32690) 2025-05-13 11:09:53 +02:00
000-mini_racer.rb DEV: Add experimental DISCOURSE_MINI_RACER_SINGLE_THREADED (#38119) 2026-02-27 15:57:02 +00:00
000-mini_sql.rb
000-pg_connection_patch.rb DEV: Patch ActiveRecord's postgresql adapter .new_client (#33820) 2025-09-18 11:34:37 +08:00
000-post_migration.rb
000-trace_pg_connections.rb DEV: Move debugging gem from byebug to debug (#34827) 2025-09-17 10:08:52 -03:00
000-zeitwerk.rb DEV: Bump latest branch version on security fixes (#37774) 2026-02-26 11:10:55 +01:00
001-redis.rb
002-freedom_patches.rb DEV: Remove the obsolete sidekiq patch (#37145) 2026-01-19 16:00:06 +01:00
002-rails_failover.rb DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
004-message_bus.rb DEV: Make changes for docker_manager Pitchfork compatibility (#36456) 2025-12-18 14:22:39 +01:00
005-site_settings.rb
006-ensure_login_hint.rb
006-mini_profiler.rb DEV: Upgrade the Redis gem to v5.4 2025-03-19 14:34:00 +01:00
008-rack-cors.rb DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
009-omniauth.rb DEV: Show unauthorized message when OAuth::Unauthorized is hit (#37776) 2026-02-12 13:41:33 -05:00
012-category_types.rb FEATURE: add category type configuration system (#37929) 2026-02-27 13:20:17 +10:00
012-web_hook_events.rb Add user_anonymized webhook event (#36208) 2025-11-25 07:43:16 -08:00
014-track-setting-changes.rb UX: Remove Bootstrap Mode (#37694) 2026-02-17 16:46:32 -03:00
015-track-upcoming-change-toggle.rb DEV: Rename experimental_ upcoming change settings (#37589) 2026-02-10 10:34:37 +10:00
099-anon-cache.rb FEATURE: Add experimental option for strict-dynamic CSP (#25664) 2024-02-16 11:16:54 +00:00
099-drain_pool.rb
100-active-support-type-extensions.rb DEV: Add symbol to ActiveModel attribute types (#36420) 2025-12-03 10:57:44 +01:00
100-custom-timezones.rb DEV: maps IST rails timezone to kolkata (#32896) 2025-05-26 08:56:04 +02:00
100-flags.rb DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
100-i18n.rb FIX: Purge ExtraLocalesController cache correctly for multisite (#32654) 2025-05-08 23:52:45 +01:00
100-logster.rb FEATURE: Automatic promotion of upcoming changes (#36211) 2025-12-08 15:49:34 +10:00
100-oj.rb
100-onebox_options.rb DEV: Add a user agent to all HTTP requests that Discourse makes. (#31555) 2025-03-03 16:32:25 +11:00
100-push-notifications.rb
100-quiet_logger.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
100-regex-timeout.rb
100-secret_token.rb
100-session_store.rb DEV: allow developers to use HTTPS if they wish (#26384) 2024-03-27 10:48:04 +11:00
100-sidekiq.rb PERF: Stop 'warming up' AR during sidekiq boot (#38126) 2026-02-27 19:29:56 +00:00
100-silence_logger.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
100-strong_parameters.rb
100-verify_config.rb
100-wrap_parameters.rb
101-lograge.rb DEV: Log HTTP_ACCEPT_LANGUAGE header in Rails logs take 2 (#35827) 2025-11-05 16:08:07 +08:00
102-truncate-logs.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
200-first_middlewares.rb PERF: Reject anonymous requests with 503 upon aggressive queuing (#36519) 2025-12-18 10:23:42 +08:00
300-perf.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
400-deprecations.rb
999-themes.rb DEV: Improve system theme loading (#34954) 2025-09-24 17:56:41 +01:00
assets.rb DEV: Introduce new rollup-based plugin build system (#35477) 2026-03-03 13:50:55 +00:00
filter_parameter_logging.rb