DEV: Move `preload-store` to `discourse/lib/preload-store`

It's only used inside Discourse so it needn't be its own module
This commit is contained in:
Robin Ward 2020-05-06 15:28:06 -04:00
parent 6c968b7945
commit 01929e3505
28 changed files with 29 additions and 33 deletions

View File

@ -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

View File

@ -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";

View File

@ -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 = {

View File

@ -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() {

View File

@ -1,4 +1,4 @@
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
import { htmlSafe } from "@ember/template";
let _customizations = {};

View File

@ -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",

View File

@ -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",

View File

@ -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 {

View File

@ -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";

View File

@ -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({

View File

@ -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";

View File

@ -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,

View File

@ -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";

View File

@ -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) {

View File

@ -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() {

View File

@ -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({

View File

@ -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";

View File

@ -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";

View File

@ -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() {

View File

@ -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";

View File

@ -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;

View File

@ -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

View File

@ -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");

View File

@ -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");

View File

@ -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: {

View File

@ -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", {

View File

@ -1,4 +1,4 @@
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
/*jshint maxlen:10000000 */
PreloadStore.store("site", {

View File

@ -1,4 +1,4 @@
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
import { Promise } from "rsvp";
QUnit.module("preload-store", {