mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 13:19:19 +08:00
Previously, lib/pretty_text.rb assembled the mini_racer context by transpiling and loading ~50 JS modules one-by-one at boot, with hand-written shims for their dependencies. This replaces that with a single Rolldown-built IIFE bundle, precompiled during assets:precompile and cached on disk under a digest of its inputs (via the new PrecompiledBundle, which AssetProcessor now shares). The set of discourse-core modules allowed into the server bundle is defined once, as PrettyText::BUNDLED_DISCOURSE_MODULES. It is passed to build.mjs (where a resolver plugin fails the build for anything outside the list, since the discourse package's exports map would otherwise silently resolve it) and also derives the cache-digest globs, so list changes force a rebuild and upstream renames fail the precompile loudly. The require() surface available to plugins' server-side markdown modules is preserved: the bundle re-registers the same loader modules the old context provided, including the vendored-dependency shims (markdown-it, xss, @embroider/macros, discourse/lib/loader-shim, etc.). The whole Ruby -> JS interface now goes through mini_racer's `call` on a single `__PrettyText` object, passing options as structured arguments, rather than building JS source strings for `eval` on every invocation. |
||
|---|---|---|
| .. | ||
| add_topic_to_quotes.rake | ||
| admin.rake | ||
| annotate.rake | ||
| annotate_rb.rake | ||
| api.rake | ||
| api_docs.rake | ||
| assets.rake | ||
| autospec.rake | ||
| avatars.rake | ||
| backfill.thor | ||
| categories.rake | ||
| cdn.rake | ||
| compatibility.rake | ||
| db.rake | ||
| db_structure.rake | ||
| destroy.rake | ||
| dev.rake | ||
| docker.rake | ||
| documentation.rake | ||
| emails.rake | ||
| export.rake | ||
| groups.rake | ||
| hashtags.rake | ||
| i18n.rake | ||
| images.rake | ||
| import.rake | ||
| incoming_emails.rake | ||
| javascript.rake | ||
| list_email_templates_strings.rake | ||
| log.rake | ||
| maxminddb.rake | ||
| migrate_advanced_search_banner_to_welcome_banner.rake | ||
| migrate_discourse_gifs_to_core.rake | ||
| nested_replies.rake | ||
| plugin.rake | ||
| populate.rake | ||
| populate.thor | ||
| posts.rake | ||
| profile.rake | ||
| qunit.rake | ||
| redis.rake | ||
| release.rake | ||
| release_note.rake | ||
| reviewables.rake | ||
| revisions.rake | ||
| rspec.rake | ||
| s3.rake | ||
| scheduler.rake | ||
| search.rake | ||
| site.rake | ||
| site_settings.rake | ||
| smoke_test.rake | ||
| svg_icons.rake | ||
| svg_sprites.rake | ||
| tags.rake | ||
| themes.rake | ||
| topic_localizations.rake | ||
| topics.rake | ||
| turbo.rake | ||
| typepad.thor | ||
| uploads.rake | ||
| user_api_key.rake | ||
| users.rake | ||