2021-01-19 05:12:45 +08:00
|
|
|
{
|
|
|
|
"name": "discourse",
|
|
|
|
"version": "0.0.0",
|
|
|
|
"private": true,
|
2022-08-18 06:27:16 +08:00
|
|
|
"description": "A platform for community discussion. Free, open, simple.",
|
|
|
|
"license": "GPL-2.0-only",
|
|
|
|
"author": "Discourse",
|
2021-01-19 05:12:45 +08:00
|
|
|
"directories": {
|
|
|
|
"doc": "doc",
|
|
|
|
"test": "tests"
|
|
|
|
},
|
|
|
|
"scripts": {
|
|
|
|
"build": "ember build",
|
|
|
|
"start": "ember serve",
|
2023-04-12 20:15:53 +08:00
|
|
|
"test": "ember test",
|
2023-09-14 19:25:06 +08:00
|
|
|
"postinstall": "../run-patch-package"
|
2021-01-19 05:12:45 +08:00
|
|
|
},
|
2021-08-27 05:19:44 +08:00
|
|
|
"dependencies": {
|
2024-03-29 05:49:34 +08:00
|
|
|
"@glimmer/syntax": "^0.91.1",
|
2023-11-11 04:39:48 +08:00
|
|
|
"@highlightjs/cdn-assets": "^11.9.0",
|
2022-11-16 16:10:58 +08:00
|
|
|
"discourse-hbr": "1.0.0",
|
|
|
|
"discourse-widget-hbs": "1.0.0",
|
2023-11-14 20:06:53 +08:00
|
|
|
"ember-route-template": "^1.0.3",
|
2024-01-11 01:30:50 +08:00
|
|
|
"ember-source": "~5.5.0",
|
2023-08-02 07:07:36 +08:00
|
|
|
"handlebars": "^4.7.8",
|
2023-11-11 04:39:48 +08:00
|
|
|
"highlight.js": "^11.9.0",
|
2024-01-02 18:47:47 +08:00
|
|
|
"jspreadsheet-ce": "^4.13.4",
|
2024-04-03 17:27:45 +08:00
|
|
|
"morphlex": "^0.0.15",
|
2023-06-30 19:01:45 +08:00
|
|
|
"pretty-text": "1.0.0"
|
2023-04-20 20:57:40 +08:00
|
|
|
},
|
|
|
|
"devDependencies": {
|
2024-03-21 07:03:29 +08:00
|
|
|
"@babel/core": "^7.24.3",
|
|
|
|
"@babel/standalone": "^7.24.3",
|
2023-08-25 19:44:26 +08:00
|
|
|
"@colors/colors": "^1.6.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"@discourse/backburner.js": "^2.7.1-0",
|
|
|
|
"@discourse/itsatrap": "^2.0.10",
|
|
|
|
"@ember-compat/tracked-built-ins": "^0.9.1",
|
2023-10-12 18:02:08 +08:00
|
|
|
"@ember/legacy-built-in-components": "^0.5.0",
|
2024-02-22 06:17:02 +08:00
|
|
|
"@ember/optional-features": "^2.1.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"@ember/render-modifiers": "^2.1.0",
|
|
|
|
"@ember/string": "^3.1.1",
|
2024-02-27 17:48:30 +08:00
|
|
|
"@ember/test-helpers": "^3.3.0",
|
2024-03-08 01:38:14 +08:00
|
|
|
"@embroider/compat": "^3.4.6",
|
|
|
|
"@embroider/core": "^3.4.6",
|
2023-08-09 19:04:41 +08:00
|
|
|
"@embroider/macros": "^1.13.1",
|
Enable Embroider/Webpack code spliting for Wizard (#24919)
(extracted from #23678)
* Move Wizard back into main app, remove Wizard addon
* Remove Wizard-related resolver or build hacks
* Install and enable `@embroider/router`
* Add "wizard" to `splitAtRoutes`
In a fully optimized Embroider app, route-based code splitting more
or less Just Work™ – install `@embroider/router`, subclass from it,
configure which routes you want to split and that's about it.
However, our app is not "fully optimized", by which I mean we are
not able to turn on all the `static*` flags.
In Embroider, "static" means "statically analyzable". Specifically
it means that all inter-dependencies between modules (files) are
explicitly expressed as `import`s, as opposed to `{{i18n ...}}`
magically means "look for the default export in app/helpers/i18n.js"
or something even more dynamic with the resolver.
Without turning on those flags, Embroider behaves conservatively,
slurps up all `app` files eagerly into the primary bundle/chunks.
So, while you _could_ turn on route-based code splitting, there
won't be much to split.
The commits leading up to this involves a bunch of refactors and
cleanups that 1) works perfectly fine in the classic build, 2) are
good and useful in their own right, but also 3) re-arranged things
such that most dependencies are now explicit.
With those in place, I was able to move all the wizard code into
the "app/static" folder. Embroider does not eagerly pull things from
this folder into any bundle, unless something explicitly "asks" for
them via `imports`. Conversely, things from this folder are not
registered with the resolver and are not added to the `loader.js`
registry.
In conjunction with route-based code splitting, we now have the
ability to split out islands of on-demand functionalities from the
main app bundle.
When you split a route in Embroider, it automatically creates a
bundle/entrypoint with the relevant routes/templates/controllers
matching that route prefix. Anything they import will be added to
the bundle as well, assuming they are not already in the main app
bundle, which is where the "app/static" folder comes into play.
The "app/static" folder name is not special. It is configured in
ember-cli-build.js. Alternatively, we could have left everything
in their normal locations, and add more fine-grained paths to the
`staticAppPaths` array. I just thought it would be easy to manage
and scale, and less error-prone to do it this way.
Note that putting things in `app/static` does not guarantee that
it would not be part of the main app bundle. For example, if we
were to add an `import ... from "app/static/wizard/...";` in a
main bundle file (say, `app.js`), then that chunk of the module
graph would be pulled in. (Consider using `await import(...)`?)
Overtime, we can build better tooling (e.g. lint rules and babel
macros to make things less repetitive) as we expand the use of
this pattern, but this is a start.
Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-12-20 21:15:06 +08:00
|
|
|
"@embroider/router": "^2.1.4",
|
2024-02-02 06:08:33 +08:00
|
|
|
"@embroider/webpack": "^3.2.2",
|
2024-02-13 05:20:12 +08:00
|
|
|
"@floating-ui/dom": "^1.6.3",
|
2023-06-30 19:01:45 +08:00
|
|
|
"@glimmer/component": "^1.1.2",
|
|
|
|
"@glimmer/tracking": "^1.1.2",
|
|
|
|
"@popperjs/core": "^2.11.8",
|
2023-11-23 06:38:00 +08:00
|
|
|
"@types/jquery": "^3.5.29",
|
2024-01-17 06:43:19 +08:00
|
|
|
"@types/qunit": "^2.19.10",
|
|
|
|
"@types/rsvp": "^4.0.9",
|
2023-07-03 08:07:34 +08:00
|
|
|
"@uppy/aws-s3": "3.0.6",
|
2023-06-30 12:05:19 +08:00
|
|
|
"@uppy/aws-s3-multipart": "3.1.3",
|
2023-06-29 23:08:33 +08:00
|
|
|
"@uppy/core": "3.0.4",
|
2024-02-21 08:13:25 +08:00
|
|
|
"@uppy/drop-target": "2.0.1",
|
2023-08-30 10:50:46 +08:00
|
|
|
"@uppy/utils": "5.4.3",
|
2023-06-29 23:08:33 +08:00
|
|
|
"@uppy/xhr-upload": "3.1.1",
|
2023-10-03 17:08:46 +08:00
|
|
|
"a11y-dialog": "8.0.4",
|
2023-06-30 19:01:45 +08:00
|
|
|
"admin": "1.0.0",
|
2024-03-02 00:20:15 +08:00
|
|
|
"autosize": "^6.0.1",
|
2023-09-26 07:47:26 +08:00
|
|
|
"babel-import-util": "^2.0.1",
|
2023-11-03 02:21:37 +08:00
|
|
|
"babel-plugin-ember-template-compilation": "^2.2.1",
|
2023-06-30 19:01:45 +08:00
|
|
|
"bootstrap": "3.4.1",
|
|
|
|
"bootstrap-json": "1.0.0",
|
2023-05-03 16:25:13 +08:00
|
|
|
"broccoli-asset-rev": "^3.0.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"deepmerge": "^4.3.1",
|
2023-07-19 02:07:20 +08:00
|
|
|
"deprecation-silencer": "1.0.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"dialog-holder": "1.0.0",
|
|
|
|
"discourse-common": "1.0.0",
|
DEV: convert I18n pseudo package into real package (discourse-i18n) (#23867)
Currently, `window.I18n` is defined in an old school hand written
script, inlined into locale/*.js by the Rails asset pipeline, and
then the global variable is shimmed into a pseudo AMD module later
in `module-shims.js`.
This approach has some problems – for one thing, when we add a new
V2 addon (e.g. in #23859), Embroider/Webpack is stricter about its
dependencies and won't let you `import from "I18n";` when `"I18n"`
isn't listed as one of its `dependencies` or `peerDependencies`.
This moves `I18n` into a real package – `discourse-i18n`. (I was
originally planning to keep the `I18n` name since it's a private
package anyway, but NPM packages are supposed to have lower case
names and that may cause problems with other tools.)
This package defines and exports a regular class, but also defines
the default global instance for backwards compatibility. We should
use the exported class in tests to make one-off instances without
mutating the global instance and having to clean it up after the
test run. However, I did not attempt that refactor in this PR.
Since `discourse-i18n` is now included by the app, the locale
scripts needs to be loaded after the app chunks. Since no "real"
work happens until later on when we kick things off in the boot
script, the order in which the script tags appear shouldn't be a
problem. Alternatively, we can rework the locale bundles to be more
lazy like everything else, and require/import them into the app.
I avoided renaming the imports in this commit since that would be
quite noisy and drowns out the actual changes here. Instead, I used
a Webpack alias to redirect the current `"I18n"` import to the new
package for the time being. In a separate commit later on, I'll
rename all the imports in oneshot and remove the alias. As always,
plugins and the legacy bundles (admin/wizard) still relies on the
runtime AMD shims regardless.
For the most part, I avoided refactoring the actual I18n code too
much other than making it a class, and some light stuff like `var`
into `let`.
However, now that it is in a reasonable format to work with (no
longer inside the global script context!) it may also be a good
opportunity to refactor and make clear what is intended to be
public API vs internal implementation details.
Speaking of, I took the librety to make `PLACEHOLDER`, `SEPARATOR`
and `I18nMissingInterpolationArgument` actual constants since it
seemed pretty clear to me those were just previously stashed on to
the `I18n` global to avoid polluting the global namespace, rather
than something we expect the consumers to set/replace.
2023-10-12 21:44:01 +08:00
|
|
|
"discourse-i18n": "1.0.0",
|
2023-11-07 00:59:49 +08:00
|
|
|
"discourse-markdown-it": "1.0.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"discourse-plugins": "1.0.0",
|
2023-12-27 08:25:43 +08:00
|
|
|
"ember-auto-import": "^2.7.2",
|
2023-06-30 19:01:45 +08:00
|
|
|
"ember-buffered-proxy": "^2.1.1",
|
2023-07-27 10:56:03 +08:00
|
|
|
"ember-cached-decorator-polyfill": "^1.0.2",
|
2024-03-07 04:05:09 +08:00
|
|
|
"ember-cli": "~5.7.0",
|
2023-06-16 07:38:49 +08:00
|
|
|
"ember-cli-app-version": "^6.0.1",
|
2023-10-11 06:18:58 +08:00
|
|
|
"ember-cli-babel": "^8.2.0",
|
2023-11-03 02:22:08 +08:00
|
|
|
"ember-cli-deprecation-workflow": "^2.2.0",
|
2023-08-09 17:26:42 +08:00
|
|
|
"ember-cli-htmlbars": "^6.3.0",
|
2023-05-03 16:25:13 +08:00
|
|
|
"ember-cli-inject-live-reload": "^2.1.0",
|
|
|
|
"ember-cli-progress-ci": "1.0.0",
|
|
|
|
"ember-cli-sri": "^2.1.1",
|
|
|
|
"ember-cli-terser": "^4.0.2",
|
2023-06-30 19:01:45 +08:00
|
|
|
"ember-decorators": "^6.1.1",
|
2024-01-11 03:57:56 +08:00
|
|
|
"ember-exam": "^9.0.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"ember-load-initializers": "^2.1.1",
|
|
|
|
"ember-modifier": "^4.1.0",
|
Upgrade ember-on-resize-modifier (#23045)
The previous version of ember-on-resize-modifier depended on
ember-modifier@^3.2.7 while discourse had ember-modifier@^4.1.0.
As far as Yarn is concerned, it can accomplish this with:
node_modules
...
ember-modifier 4.1.0
...
ember-on-resize-modifier 1.1.0
...
ember-modifier 3.2.7
...
...
This does NOT work!
In a classic build everything is compiled down to AMD modules and
at runtime there can only be one uniquely named "ember-modifier"
module. When we have duplicates, depending on activation ordering,
one of them will randomly win.
In practice, it seems like ember-modifier 3.2.7 had "won" in the
current build, and we are shipping it to production, you can find
these modules in vendor.js like:
```js
;define("ember-modifier/-private/class/modifier", /* ... */, function(/* ... */) {
/* the 3.2.7 version with deprecations, etc */
})
/* ... */
;define("ember-modifier/index", /* ... */)
```
However, ember-auto-import also "found" the 4.1.0 version and in
one of the chunk.app.js:
```js
d('ember-modifier', /* ... */, function() { return __webpack_require__(/*! ember-modifier */ 227); });
```
...and in one of the chunk.vendors.js...
```js
/* 227 */
/*!****************************************************!*\
!*** ../node_modules/ember-modifier/dist/index.js ***!
\****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* ...the 4.1.0 version... */
}),
```
So, in practice:
* We are brining both copies into the production build
* The 3.2.7 modules are available in the AMD loader as "ember-modifier/..."
* But 4.1.0 modules are available in the AMD loader as "ember-modifier"
* Because mostly it's consumed as `import ... from "ember-modifier";`, the
latter end up actually winning
* Because the newer code is compatible enough, and the deprecated features
are unused, it seems to work ok..?
But in the Embroider build, ember-auto-import doesn't emit those shims
anymore. It does process most of the core modules through Webpack so the
imports get correctly wired up to the 4.1.0 as expected, as they no longer
go through/need the runtime AMD loader.js.
The older 3.2.7 copy is _still_ shipped in the vendor bundle and registered
the same, but not "stomped over" by the EAI shims anymore. Our manual shims
(#22703, merged yesterday) are more "polite" and check `require.has(...)`
before defining the module, and since `require.has(...)` check for the
`/index` alias and returns `true`, our shim does not stomp the 3.2.7 modules
either.
So then, when our "auxilary bundles" (admin, plugins, etc) tries to import
`"ember-modifier", they get the 3.2.7 version.
2023-08-10 17:28:39 +08:00
|
|
|
"ember-on-resize-modifier": "^2.0.2",
|
2023-06-30 19:01:45 +08:00
|
|
|
"ember-production-deprecations": "1.0.0",
|
2024-02-27 00:18:33 +08:00
|
|
|
"ember-qunit": "^8.0.2",
|
2024-02-06 07:11:40 +08:00
|
|
|
"ember-template-imports": "^4.1.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"ember-test-selectors": "^6.0.0",
|
2023-10-02 18:36:06 +08:00
|
|
|
"float-kit": "1.0.0",
|
2024-03-06 05:56:43 +08:00
|
|
|
"html-entities": "^2.5.2",
|
2024-01-17 06:44:00 +08:00
|
|
|
"imports-loader": "^5.0.0",
|
2023-10-26 06:39:40 +08:00
|
|
|
"jquery": "^3.7.1",
|
2023-06-30 19:01:45 +08:00
|
|
|
"js-yaml": "^4.1.0",
|
2023-05-03 16:25:13 +08:00
|
|
|
"loader.js": "^4.7.0",
|
2023-08-15 10:20:55 +08:00
|
|
|
"message-bus-client": "^4.3.8",
|
2023-06-30 19:01:45 +08:00
|
|
|
"messageformat": "0.1.5",
|
2023-05-03 16:25:13 +08:00
|
|
|
"pretender": "^3.4.7",
|
2024-02-19 09:12:42 +08:00
|
|
|
"qunit": "^2.20.1",
|
2023-10-13 09:00:58 +08:00
|
|
|
"qunit-dom": "^3.0.0",
|
2024-03-14 05:52:49 +08:00
|
|
|
"sass": "^1.72.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"select-kit": "1.0.0",
|
2023-11-03 02:22:26 +08:00
|
|
|
"sinon": "^17.0.1",
|
2023-05-03 16:25:13 +08:00
|
|
|
"source-map": "^0.7.4",
|
2024-04-03 07:14:09 +08:00
|
|
|
"terser": "^5.30.2",
|
2023-07-21 04:01:12 +08:00
|
|
|
"truth-helpers": "1.0.0",
|
2023-06-30 19:01:45 +08:00
|
|
|
"util": "^0.12.5",
|
|
|
|
"virtual-dom": "^2.1.1",
|
2024-03-21 07:03:20 +08:00
|
|
|
"webpack": "^5.91.0",
|
2023-11-07 18:24:49 +08:00
|
|
|
"webpack-stats-plugin": "^1.1.3",
|
2023-06-12 19:28:40 +08:00
|
|
|
"workbox-cacheable-response": "^7.0.0",
|
|
|
|
"workbox-core": "^7.0.0",
|
|
|
|
"workbox-expiration": "^7.0.0",
|
|
|
|
"workbox-routing": "^7.0.0",
|
|
|
|
"workbox-strategies": "^7.0.0",
|
DEV: move xss dependency into core (#23094)
This resolves the issue in #23064.
This issue arises because we need to produce the trees for the
auxilary bundles in `ember-cli-build.js` to pass these trees as
argument to `app.toTree()`. In order to produce these trees, the
code internally need to set up babel, which deep-clones the addons'
babel configs.
When using `@embroider/macros`, the addon's babel config includes a
`MacrosConfig` object which is not supposed to be touched until the
configs are "finalized". In a classic build, the finalization step
happens when `app.toTree()` is called. In Embroider, this happens
somewhere deeper inside `CompatApp`.
We need to produce these auxilary bundle trees before we call
`app.toTree()` or before constructing `CompatApp` because they
need to be passed as arguments to these functions. So this poses a
tricky chicken-and-egg timing issue. It was difficult to find a
workaround for this that works for both the classic and Embroider
build pipeline.
Of all the internal addons that uses the auxilary bundle pattern,
this only affets `pretty-text` as it is (for now, at least) the
only addon that uses `@embroider/macros`.
Taking a step back, the only reason (for now, at least) it was
introduced was for the loader shim for the `xss` package. This
package is actually used inside the lazily loaded markdown-it
bundle. However, we didn't have a better way to include the dep
into the lazy bundle directly, so it ends up going into the main
addon tree, and, inturns, the discourse core bundle.
In core's main loader shim manifest, we already have an entry for
`xss`. This was perhaps a mistake at the time, but it doesn't make
a difference – as mentioned above, `xss` needs to be included into
the main bundle anyway.
So, for now, the simpliest solution is to avoid `@embroider/macros`
in these internal addons for the time being. Ideally we would soon
absorb these back into core as lazily loaded (`import()`-ed) code
managed by Webpack when we fully switch over to Embroider.
2023-08-15 23:13:26 +08:00
|
|
|
"workbox-sw": "^7.0.0",
|
2024-03-04 09:04:07 +08:00
|
|
|
"xss": "^1.0.15"
|
2023-06-30 19:01:45 +08:00
|
|
|
},
|
|
|
|
"engines": {
|
2024-02-27 17:48:30 +08:00
|
|
|
"node": ">= 18",
|
2023-06-30 19:01:45 +08:00
|
|
|
"npm": "please-use-yarn",
|
|
|
|
"yarn": ">= 1.21.1"
|
|
|
|
},
|
|
|
|
"ember": {
|
2023-07-18 17:00:19 +08:00
|
|
|
"edition": "octane"
|
2021-01-19 05:12:45 +08:00
|
|
|
}
|
|
|
|
}
|