mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 18:54:13 +08:00
e0d8dae0b3
Previously, calling `decorateCookedElement` would re-open a number of components and introduce new event listeners. This kind of thing cannot be undone, and so we were forced to introduce the unique 'id' parameter. If a given decorator id had already been applied, we would skip re-applying it. This helped, but it was still problematic because all tests would be using the callback which was registered in the first test. If its closure had any references to the ApplicationInstance, then those references would be destroyed and useless in future tests. This commit switches strategy to use `appEvents` instead of `klass.reopen`. This is a much more obvious system and, since appEvent registrations are reset for every ApplicationInstance, we can drop the requirement for unique ids on `decorateCookedElement` calls. The callback used will always be the one registered against the current ApplicationInstance. This commit also updates our `wrapWithErrorHandler` implementation so that it throws errors in tests. This ensures that errors are not silently swallowed in CI. |
||
---|---|---|
.. | ||
admin | ||
bootstrap-json | ||
confirm-new-email | ||
deprecation-silencer | ||
dialog-holder | ||
discourse | ||
discourse-common | ||
discourse-hbr | ||
discourse-plugins | ||
discourse-widget-hbs | ||
docs | ||
ember-addons | ||
ember-cli-progress-ci | ||
ember-production-deprecations | ||
float-kit | ||
locales | ||
patches | ||
pretty-text | ||
select-kit | ||
truth-helpers | ||
wizard | ||
.licensee.json | ||
.npmrc | ||
handlebars-shim.js | ||
js-processor.js | ||
package.json | ||
polyfills.js | ||
service-worker.js.erb | ||
yarn.lock |