Sync up master with Ember CLI branch where possible (#11707)

These changes should all be safe to live in master even if they're not
being used yet.
This commit is contained in:
Robin Ward 2021-01-14 12:52:51 -05:00 committed by GitHub
parent c3bab3ef38
commit 4321a55b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 0 deletions

View File

@ -17,10 +17,19 @@ define("message-bus-client", ["exports"], function (__exports__) {
__exports__.default = window.MessageBus;
});
define("mousetrap-global-bind", ["exports"], function (__exports__) {
// In the Rails app it's applied from the vendored file
__exports__.default = {};
});
define("ember-buffered-proxy/proxy", ["exports"], function (__exports__) {
__exports__.default = window.BufferedProxy;
});
define("ember-buffered-proxy/mixin", ["exports"], function (__exports__) {
__exports__.default = null;
});
define("bootbox", ["exports"], function (__exports__) {
__exports__.default = window.bootbox;
});

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Discourse - Ember CLI</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for "head"}}
</head>
<body>
{{content-for "body"}}
<section id='main'>
</section>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/discourse.js"></script>
<script src="{{rootURL}}assets/admin.js"></script>
<script src="{{rootURL}}assets/scripts/discourse-boot.js"></script>
<script>
document.addEventListener("discourse-booted", (e) => {
const config = e.detail;
const app = require(`${config.modulePrefix}/app`)["default"].create(
config
);
app.start();
});
</script>
{{content-for "body-footer"}}
</body>
</html>

View File

@ -1,10 +1,14 @@
import KeyboardShortcuts from "discourse/lib/keyboard-shortcuts";
import Mousetrap from "mousetrap";
import bindGlobal from "mousetrap-global-bind";
export default {
name: "keyboard-shortcuts",
initialize(container) {
// Ensure mousetrap-global-bind is executed
void bindGlobal;
KeyboardShortcuts.init(Mousetrap, container);
KeyboardShortcuts.bindEvents();
},

View File

@ -0,0 +1,51 @@
"use strict";
module.exports = function (environment) {
let ENV = {
modulePrefix: "discourse",
environment,
rootURL: "/",
locationType: "auto",
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false,
},
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
},
};
if (environment === "development") {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
}
if (environment === "test") {
// Testem prefers this...
ENV.locationType = "none";
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = "#ember-testing";
ENV.APP.autoboot = false;
}
if (environment === "production") {
// here you can enable a production-specific feature
}
return ENV;
};

View File

@ -0,0 +1,5 @@
{
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": true
}

View File

@ -0,0 +1,18 @@
"use strict";
const browsers = [
"last 1 Chrome versions",
"last 1 Firefox versions",
"last 1 Safari versions",
];
const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === "production";
if (isCI || isProduction) {
browsers.push("ie 11");
}
module.exports = {
browsers,
};