mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Rename deprecated
to the more appropriate app-boot
This commit is contained in:
parent
cdbba81ee0
commit
e57fd283db
11
app/assets/javascripts/app-boot.js
Normal file
11
app/assets/javascripts/app-boot.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// discourse-skip-module
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
if (window.unsupportedBrowser) {
|
||||||
|
throw "Unsupported browser detected";
|
||||||
|
}
|
||||||
|
let Discourse = requirejs("discourse/app").default;
|
||||||
|
|
||||||
|
// ensure Discourse is added as a global
|
||||||
|
window.Discourse = Discourse;
|
||||||
|
})();
|
@ -2,7 +2,7 @@
|
|||||||
//= require ./polyfills
|
//= require ./polyfills
|
||||||
//= require_tree ./select-kit
|
//= require_tree ./select-kit
|
||||||
//= require ./discourse/app/app
|
//= require ./discourse/app/app
|
||||||
//= require ./deprecated
|
//= require ./app-boot
|
||||||
|
|
||||||
// Stuff we need to load first
|
// Stuff we need to load first
|
||||||
//= require ./discourse/app/lib/to-markdown
|
//= require ./discourse/app/lib/to-markdown
|
||||||
@ -97,4 +97,5 @@
|
|||||||
//= require_tree ./discourse/app/pre-initializers
|
//= require_tree ./discourse/app/pre-initializers
|
||||||
//= require_tree ./discourse/app/initializers
|
//= require_tree ./discourse/app/initializers
|
||||||
//= require_tree ./discourse/app/services
|
//= require_tree ./discourse/app/services
|
||||||
|
|
||||||
//= require_tree ./discourse/app/widgets
|
//= require_tree ./discourse/app/widgets
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
// ensure Discourse is added as a global
|
|
||||||
(function() {
|
|
||||||
window.Discourse = requirejs("discourse/app").default;
|
|
||||||
})();
|
|
@ -1,14 +1,9 @@
|
|||||||
/*global Mousetrap:true*/
|
/*global Mousetrap:true*/
|
||||||
import Application from "@ember/application";
|
import Application from "@ember/application";
|
||||||
import EmberObject, { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import { buildResolver } from "discourse-common/resolver";
|
import { buildResolver } from "discourse-common/resolver";
|
||||||
import discourseComputed, { observes } from "discourse-common/utils/decorators";
|
import discourseComputed, { observes } from "discourse-common/utils/decorators";
|
||||||
import FocusEvent from "discourse-common/mixins/focus-event";
|
import FocusEvent from "discourse-common/mixins/focus-event";
|
||||||
import deprecated from "discourse-common/lib/deprecated";
|
|
||||||
|
|
||||||
if (window.unsupportedBrowser) {
|
|
||||||
throw "Unsupported browser detected";
|
|
||||||
}
|
|
||||||
|
|
||||||
const _pluginCallbacks = [];
|
const _pluginCallbacks = [];
|
||||||
|
|
||||||
@ -204,14 +199,4 @@ const Discourse = Application.extend(FocusEvent, {
|
|||||||
})
|
})
|
||||||
}).create();
|
}).create();
|
||||||
|
|
||||||
Object.defineProperty(Discourse, "Model", {
|
|
||||||
get() {
|
|
||||||
deprecated("Use an `@ember/object` instead of Discourse.Model", {
|
|
||||||
since: "2.4.0",
|
|
||||||
dropFrom: "2.5.0"
|
|
||||||
});
|
|
||||||
return EmberObject;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default Discourse;
|
export default Discourse;
|
||||||
|
@ -2,7 +2,6 @@ import Session from "discourse/models/session";
|
|||||||
import KeyValueStore from "discourse/lib/key-value-store";
|
import KeyValueStore from "discourse/lib/key-value-store";
|
||||||
import Store from "discourse/models/store";
|
import Store from "discourse/models/store";
|
||||||
import DiscourseLocation from "discourse/lib/discourse-location";
|
import DiscourseLocation from "discourse/lib/discourse-location";
|
||||||
import Discourse from "discourse/app";
|
|
||||||
import SearchService from "discourse/services/search";
|
import SearchService from "discourse/services/search";
|
||||||
import TopicTrackingState, {
|
import TopicTrackingState, {
|
||||||
startTracking
|
startTracking
|
||||||
@ -33,7 +32,7 @@ export default {
|
|||||||
|
|
||||||
const currentUser = User.current();
|
const currentUser = User.current();
|
||||||
app.register("current-user:main", currentUser, { instantiate: false });
|
app.register("current-user:main", currentUser, { instantiate: false });
|
||||||
Discourse.currentUser = currentUser;
|
app.currentUser = currentUser;
|
||||||
|
|
||||||
const topicTrackingState = TopicTrackingState.create({
|
const topicTrackingState = TopicTrackingState.create({
|
||||||
messageBus,
|
messageBus,
|
||||||
@ -46,7 +45,7 @@ export default {
|
|||||||
app.inject(t, "topicTrackingState", "topic-tracking-state:main")
|
app.inject(t, "topicTrackingState", "topic-tracking-state:main")
|
||||||
);
|
);
|
||||||
|
|
||||||
const siteSettings = Discourse.SiteSettings;
|
const siteSettings = app.SiteSettings;
|
||||||
app.register("site-settings:main", siteSettings, { instantiate: false });
|
app.register("site-settings:main", siteSettings, { instantiate: false });
|
||||||
ALL_TARGETS.forEach(t =>
|
ALL_TARGETS.forEach(t =>
|
||||||
app.inject(t, "siteSettings", "site-settings:main")
|
app.inject(t, "siteSettings", "site-settings:main")
|
||||||
|
@ -57,6 +57,7 @@ class DiscourseJsProcessor
|
|||||||
activate-account
|
activate-account
|
||||||
auto-redirect
|
auto-redirect
|
||||||
embed-application
|
embed-application
|
||||||
|
app-boot
|
||||||
).any? { |f| relative_path == "#{js_root}/#{f}.js" }
|
).any? { |f| relative_path == "#{js_root}/#{f}.js" }
|
||||||
|
|
||||||
return true if plugin_transpile_paths.any? { |prefix| relative_path.start_with?(prefix) }
|
return true if plugin_transpile_paths.any? { |prefix| relative_path.start_with?(prefix) }
|
||||||
|
Loading…
Reference in New Issue
Block a user