Skip to content

Commit

Permalink
DEV: Move preload-store to discourse/lib/preload-store
Browse files Browse the repository at this point in the history
It's only used inside Discourse so it needn't be its own module
  • Loading branch information
eviltrout committed May 6, 2020
1 parent 6c968b7 commit 01929e3
Show file tree
Hide file tree
Showing 28 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/admin/routes/admin-backups.js
Expand Up @@ -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";
Expand Down
3 changes: 2 additions & 1 deletion app/assets/javascripts/discourse-loader.js
Expand Up @@ -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 = {
Expand Down
@@ -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() {
Expand Down
@@ -1,4 +1,4 @@
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
import { htmlSafe } from "@ember/template";

let _customizations = {};
Expand Down
@@ -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",
Expand Down
@@ -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",
Expand Down
@@ -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 {
Expand Down
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/models/site.js
Expand Up @@ -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({
Expand Down
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/models/topic.js
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/models/user.js
Expand Up @@ -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";
Expand Down
@@ -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) {
Expand Down
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion 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({
Expand Down
Expand Up @@ -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";
Expand Down
Expand Up @@ -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";

Expand Down
@@ -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() {
Expand Down
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion 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;

Expand Down
1 change: 0 additions & 1 deletion lib/discourse_js_processor.rb
Expand Up @@ -48,7 +48,6 @@ def self.should_transpile?(filename)
return false if relative_path.start_with?("#{js_root}/plugins/")

return true if %w(
preload-store
preload-application-data
wizard-start
onpopstate-handler
Expand Down
2 changes: 1 addition & 1 deletion 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");

Expand Down
2 changes: 1 addition & 1 deletion 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");

Expand Down
2 changes: 1 addition & 1 deletion 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: {
Expand Down
2 changes: 1 addition & 1 deletion 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", {
Expand Down
2 changes: 1 addition & 1 deletion 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", {
Expand Down
2 changes: 1 addition & 1 deletion 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", {
Expand Down

1 comment on commit 01929e3

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/custom-wizard-plugin/73345/558

Please sign in to comment.