Skip to content

A platform for community discussion. Free, open, simple.

Temporary fix: Don't use ember imports in pretty text

Robin Wardcfa5d123a3a4
diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js
index 878f16e4718..68128b1f6a6 100644
--- a/app/assets/javascripts/discourse-loader.js
+++ b/app/assets/javascripts/discourse-loader.js
@@ -31,6 +31,12 @@ var define, requirejs;
inject: Ember.inject.service
}
};
+ } else if (typeof __PRETTY_TEXT !== "undefined") {
+ // This is a hack because our server side code includes the pretty_text bundle
+ // which relies on ember now that we're using modules properly.
+ // The proper fix would be to move the upload urls code out of the pretty text
+ // bundle and remove this code. It should never be called;
+ EMBER_MODULES["@ember/runloop"] = {};
}
var _isArray;
diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb
index d620320f1b0..8be13974974 100644
--- a/lib/pretty_text.rb
+++ b/lib/pretty_text.rb
@@ -73,6 +73,7 @@ module PrettyText
ctx.attach("console.log", proc { |l| p l })
ctx.eval('window.console = console;')
end
+ ctx.eval("__PRETTY_TEXT = true")
ctx_load(ctx, "#{Rails.root}/app/assets/javascripts/discourse-loader.js")
ctx_load(ctx, "vendor/assets/javascripts/lodash.js")