diff --git a/app/assets/javascripts/admin/routes/admin-backups-logs.js b/app/assets/javascripts/admin/routes/admin-backups-logs.js index 3d24756a4ab..2c7e16eed7a 100644 --- a/app/assets/javascripts/admin/routes/admin-backups-logs.js +++ b/app/assets/javascripts/admin/routes/admin-backups-logs.js @@ -1,6 +1,6 @@ import EmberObject from "@ember/object"; import Route from "@ember/routing/route"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; export default Route.extend({ // since the logs are pushed via the message bus diff --git a/app/assets/javascripts/admin/routes/admin-backups.js b/app/assets/javascripts/admin/routes/admin-backups.js index 6bc42d725f2..85bfc197b98 100644 --- a/app/assets/javascripts/admin/routes/admin-backups.js +++ b/app/assets/javascripts/admin/routes/admin-backups.js @@ -4,7 +4,7 @@ import { ajax } from "discourse/lib/ajax"; import showModal from "discourse/lib/show-modal"; import BackupStatus from "admin/models/backup-status"; import Backup from "admin/models/backup"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import User from "discourse/models/user"; const LOG_CHANNEL = "/admin/backups/logs"; diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js index 5d189a28573..e14a457bd1e 100644 --- a/app/assets/javascripts/discourse-loader.js +++ b/app/assets/javascripts/discourse-loader.js @@ -6,7 +6,8 @@ var define, requirejs; var ALIASES = { "ember-addons/ember-computed-decorators": "discourse-common/utils/decorators", - "discourse/lib/raw-templates": "discourse-common/lib/raw-templates" + "discourse/lib/raw-templates": "discourse-common/lib/raw-templates", + "preload-store": "discourse/lib/preload-store" }; if (typeof Ember !== "undefined") { EMBER_MODULES = { diff --git a/app/assets/javascripts/discourse/app/adapters/topic-list.js b/app/assets/javascripts/discourse/app/adapters/topic-list.js index 3d280047eb9..bd45b85e094 100644 --- a/app/assets/javascripts/discourse/app/adapters/topic-list.js +++ b/app/assets/javascripts/discourse/app/adapters/topic-list.js @@ -1,6 +1,6 @@ import { ajax } from "discourse/lib/ajax"; import RestAdapter from "discourse/adapters/rest"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; export function finderFor(filter, params) { return function() { diff --git a/app/assets/javascripts/discourse/app/helpers/custom-html.js b/app/assets/javascripts/discourse/app/helpers/custom-html.js index b9d424a2c9f..202476fcda1 100644 --- a/app/assets/javascripts/discourse/app/helpers/custom-html.js +++ b/app/assets/javascripts/discourse/app/helpers/custom-html.js @@ -1,4 +1,4 @@ -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { htmlSafe } from "@ember/template"; let _customizations = {}; diff --git a/app/assets/javascripts/discourse/app/initializers/banner.js b/app/assets/javascripts/discourse/app/initializers/banner.js index ccec6a95b49..91e3ab3a6a4 100644 --- a/app/assets/javascripts/discourse/app/initializers/banner.js +++ b/app/assets/javascripts/discourse/app/initializers/banner.js @@ -1,5 +1,5 @@ import EmberObject from "@ember/object"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; export default { name: "banner", diff --git a/app/assets/javascripts/discourse/app/initializers/enable-emoji.js b/app/assets/javascripts/discourse/app/initializers/enable-emoji.js index a6e3e6d03ad..fd91b69aec8 100644 --- a/app/assets/javascripts/discourse/app/initializers/enable-emoji.js +++ b/app/assets/javascripts/discourse/app/initializers/enable-emoji.js @@ -1,6 +1,6 @@ import { withPluginApi } from "discourse/lib/plugin-api"; import { registerEmoji } from "pretty-text/emoji"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; export default { name: "enable-emoji", diff --git a/app/assets/javascripts/preload-store.js b/app/assets/javascripts/discourse/app/lib/preload-store.js similarity index 86% rename from app/assets/javascripts/preload-store.js rename to app/assets/javascripts/discourse/app/lib/preload-store.js index 132588695b0..ebee66cfceb 100644 --- a/app/assets/javascripts/preload-store.js +++ b/app/assets/javascripts/discourse/app/lib/preload-store.js @@ -1,9 +1,5 @@ -/** - We can insert data into the PreloadStore when the document is loaded. - The data can be accessed once by a key, after which it is removed - - @class PreloadStore -**/ +// We can insert data into the PreloadStore when the document is loaded. +// The data can be accessed once by a key, after which it is removed import { Promise } from "rsvp"; export default { diff --git a/app/assets/javascripts/discourse/app/models/category-list.js b/app/assets/javascripts/discourse/app/models/category-list.js index ce655978b35..e3c028e156d 100644 --- a/app/assets/javascripts/discourse/app/models/category-list.js +++ b/app/assets/javascripts/discourse/app/models/category-list.js @@ -1,5 +1,5 @@ import ArrayProxy from "@ember/array/proxy"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { ajax } from "discourse/lib/ajax"; import Topic from "discourse/models/topic"; import Category from "discourse/models/category"; diff --git a/app/assets/javascripts/discourse/app/models/site.js b/app/assets/javascripts/discourse/app/models/site.js index 29de94c3a8e..455368bf85c 100644 --- a/app/assets/javascripts/discourse/app/models/site.js +++ b/app/assets/javascripts/discourse/app/models/site.js @@ -7,7 +7,7 @@ import PostActionType from "discourse/models/post-action-type"; import Singleton from "discourse/mixins/singleton"; import RestModel from "discourse/models/rest"; import TrustLevel from "discourse/models/trust-level"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import deprecated from "discourse-common/lib/deprecated"; const Site = RestModel.extend({ diff --git a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js index bccb7747ebf..7cb74d88453 100644 --- a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js +++ b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js @@ -2,7 +2,7 @@ import EmberObject, { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { NotificationLevels } from "discourse/lib/notification-levels"; import discourseComputed, { on } from "discourse-common/utils/decorators"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import Category from "discourse/models/category"; import User from "discourse/models/user"; diff --git a/app/assets/javascripts/discourse/app/models/topic.js b/app/assets/javascripts/discourse/app/models/topic.js index 00f8c8839f6..573104b6eb3 100644 --- a/app/assets/javascripts/discourse/app/models/topic.js +++ b/app/assets/javascripts/discourse/app/models/topic.js @@ -10,7 +10,7 @@ import ActionSummary from "discourse/models/action-summary"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { censor } from "pretty-text/censored-words"; import { emojiUnescape } from "discourse/lib/text"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { userPath } from "discourse/lib/url"; import discourseComputed, { observes, diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.js index bebf2d3dcb7..6f4cf5dfcfe 100644 --- a/app/assets/javascripts/discourse/app/models/user.js +++ b/app/assets/javascripts/discourse/app/models/user.js @@ -18,7 +18,7 @@ import UserAction from "discourse/models/user-action"; import UserDraftsStream from "discourse/models/user-drafts-stream"; import Group from "discourse/models/group"; import { emojiUnescape } from "discourse/lib/text"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { defaultHomepage } from "discourse/lib/utilities"; import { userPath } from "discourse/lib/url"; import Category from "discourse/models/category"; diff --git a/app/assets/javascripts/discourse/app/routes/account-created.js b/app/assets/javascripts/discourse/app/routes/account-created.js index 901f6c0ffb7..3ba5e2ca4ed 100644 --- a/app/assets/javascripts/discourse/app/routes/account-created.js +++ b/app/assets/javascripts/discourse/app/routes/account-created.js @@ -1,5 +1,5 @@ import Route from "@ember/routing/route"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; export default Route.extend({ setupController(controller) { diff --git a/app/assets/javascripts/discourse/app/routes/badges-index.js b/app/assets/javascripts/discourse/app/routes/badges-index.js index c4acb15592f..142a9ef807d 100644 --- a/app/assets/javascripts/discourse/app/routes/badges-index.js +++ b/app/assets/javascripts/discourse/app/routes/badges-index.js @@ -1,6 +1,6 @@ import DiscourseRoute from "discourse/routes/discourse"; import Badge from "discourse/models/badge"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; export default DiscourseRoute.extend({ model() { diff --git a/app/assets/javascripts/discourse/app/routes/badges-show.js b/app/assets/javascripts/discourse/app/routes/badges-show.js index 86b8f0d4afc..b4c0b6e681c 100644 --- a/app/assets/javascripts/discourse/app/routes/badges-show.js +++ b/app/assets/javascripts/discourse/app/routes/badges-show.js @@ -1,7 +1,7 @@ import DiscourseRoute from "discourse/routes/discourse"; import UserBadge from "discourse/models/user-badge"; import Badge from "discourse/models/badge"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { hash } from "rsvp"; export default DiscourseRoute.extend({ diff --git a/app/assets/javascripts/discourse/app/routes/discovery-categories.js b/app/assets/javascripts/discourse/app/routes/discovery-categories.js index 2770a8093ed..ba07642941a 100644 --- a/app/assets/javascripts/discourse/app/routes/discovery-categories.js +++ b/app/assets/javascripts/discourse/app/routes/discovery-categories.js @@ -7,7 +7,7 @@ import CategoryList from "discourse/models/category-list"; import { defaultHomepage } from "discourse/lib/utilities"; import TopicList from "discourse/models/topic-list"; import { ajax } from "discourse/lib/ajax"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { searchPriorities } from "discourse/components/concerns/category-search-priorities"; import { hash } from "rsvp"; import Site from "discourse/models/site"; diff --git a/app/assets/javascripts/discourse/app/routes/full-page-search.js b/app/assets/javascripts/discourse/app/routes/full-page-search.js index 6fe75cd83b3..e95c6f8745b 100644 --- a/app/assets/javascripts/discourse/app/routes/full-page-search.js +++ b/app/assets/javascripts/discourse/app/routes/full-page-search.js @@ -5,7 +5,7 @@ import { getSearchKey, isValidSearchTerm } from "discourse/lib/search"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { getTransient, setTransient } from "discourse/lib/page-tracker"; import { escapeExpression } from "discourse/lib/utilities"; diff --git a/app/assets/javascripts/discourse/app/routes/invites-show.js b/app/assets/javascripts/discourse/app/routes/invites-show.js index 7ec701b8427..ded630dc8c0 100644 --- a/app/assets/javascripts/discourse/app/routes/invites-show.js +++ b/app/assets/javascripts/discourse/app/routes/invites-show.js @@ -1,5 +1,5 @@ import DiscourseRoute from "discourse/routes/discourse"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; export default DiscourseRoute.extend({ titleToken() { diff --git a/app/assets/javascripts/discourse/app/routes/password-reset.js b/app/assets/javascripts/discourse/app/routes/password-reset.js index 393b19f96ae..58e690fac8c 100644 --- a/app/assets/javascripts/discourse/app/routes/password-reset.js +++ b/app/assets/javascripts/discourse/app/routes/password-reset.js @@ -1,5 +1,5 @@ import DiscourseRoute from "discourse/routes/discourse"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { ajax } from "discourse/lib/ajax"; import { userPath } from "discourse/lib/url"; diff --git a/app/assets/javascripts/preload-application-data.js b/app/assets/javascripts/preload-application-data.js index c72d4a66d1f..0b93ded00d4 100644 --- a/app/assets/javascripts/preload-application-data.js +++ b/app/assets/javascripts/preload-application-data.js @@ -1,6 +1,6 @@ // discourse-skip-module (function() { - const ps = require("preload-store").default; + const ps = require("discourse/lib/preload-store").default; const preloadedDataElement = document.getElementById("data-preloaded"); const setupData = document.getElementById("data-discourse-setup").dataset; diff --git a/lib/discourse_js_processor.rb b/lib/discourse_js_processor.rb index 1aa140aebf1..94e39d0d82f 100644 --- a/lib/discourse_js_processor.rb +++ b/lib/discourse_js_processor.rb @@ -48,7 +48,6 @@ class DiscourseJsProcessor return false if relative_path.start_with?("#{js_root}/plugins/") return true if %w( - preload-store preload-application-data wizard-start onpopstate-handler diff --git a/test/javascripts/acceptance/account-created-test.js b/test/javascripts/acceptance/account-created-test.js index e9d57d9389a..3b2dad73f88 100644 --- a/test/javascripts/acceptance/account-created-test.js +++ b/test/javascripts/acceptance/account-created-test.js @@ -1,5 +1,5 @@ import { acceptance } from "helpers/qunit-helpers"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; acceptance("Account Created"); diff --git a/test/javascripts/acceptance/custom-html-set-test.js b/test/javascripts/acceptance/custom-html-set-test.js index 8df5e7e3a1c..fa5a94a8f9f 100644 --- a/test/javascripts/acceptance/custom-html-set-test.js +++ b/test/javascripts/acceptance/custom-html-set-test.js @@ -1,6 +1,6 @@ import { acceptance } from "helpers/qunit-helpers"; import { setCustomHTML } from "discourse/helpers/custom-html"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; acceptance("CustomHTML set"); diff --git a/test/javascripts/acceptance/invite-accept-test.js b/test/javascripts/acceptance/invite-accept-test.js index 6078bce9ef6..27fd0233949 100644 --- a/test/javascripts/acceptance/invite-accept-test.js +++ b/test/javascripts/acceptance/invite-accept-test.js @@ -1,5 +1,5 @@ import { acceptance } from "helpers/qunit-helpers"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; acceptance("Invite Accept", { settings: { diff --git a/test/javascripts/acceptance/password-reset-test.js b/test/javascripts/acceptance/password-reset-test.js index 476c426f9fc..0bec0150501 100644 --- a/test/javascripts/acceptance/password-reset-test.js +++ b/test/javascripts/acceptance/password-reset-test.js @@ -1,5 +1,5 @@ import { acceptance } from "helpers/qunit-helpers"; -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { parsePostData } from "helpers/create-pretender"; acceptance("Password Reset", { diff --git a/test/javascripts/helpers/site.js b/test/javascripts/helpers/site.js index 7c4b2273dd9..ce7ffc8825c 100644 --- a/test/javascripts/helpers/site.js +++ b/test/javascripts/helpers/site.js @@ -1,4 +1,4 @@ -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; /*jshint maxlen:10000000 */ PreloadStore.store("site", { diff --git a/test/javascripts/lib/preload-store-test.js b/test/javascripts/lib/preload-store-test.js index e25e89ee82c..effb683e663 100644 --- a/test/javascripts/lib/preload-store-test.js +++ b/test/javascripts/lib/preload-store-test.js @@ -1,4 +1,4 @@ -import PreloadStore from "preload-store"; +import PreloadStore from "discourse/lib/preload-store"; import { Promise } from "rsvp"; QUnit.module("preload-store", {