Skip to content

Commit 3e93733

Browse files
authored
Merge pull request #713 from dnalagatla/dnalagatla/reverting-embroider-support-706
Revert embroider related updates to fix #706
2 parents 408b42f + a82a966 commit 3e93733

3 files changed

Lines changed: 12 additions & 26 deletions

File tree

index.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ function getVersionChecker(context) {
2929
return checker;
3030
}
3131

32-
function stripLeadingSlash(filePath) {
33-
return filePath.replace(/^\//, '');
34-
}
32+
3533

3634
/*
3735
* Main entrypoint for the Ember CLI addon.
@@ -108,6 +106,11 @@ module.exports = {
108106
return "<!-- EMBER_CLI_FASTBOOT_TITLE --><!-- EMBER_CLI_FASTBOOT_HEAD -->";
109107
}
110108

109+
if (type === 'app-boot') {
110+
const isModuleUnification = (typeof this.project.isModuleUnification === 'function') && this.project.isModuleUnification();
111+
return fastbootAppModule(config.modulePrefix, JSON.stringify(config.APP || {}), isModuleUnification);
112+
}
113+
111114
// if the fastboot addon is installed, we overwrite the config-module so that the config can be read
112115
// from meta tag/directly for browser build and from Fastboot config for fastboot target.
113116
if (type === 'config-module') {
@@ -193,6 +196,10 @@ module.exports = {
193196
registry: this._appRegistry
194197
});
195198

199+
function stripLeadingSlash(filePath) {
200+
return filePath.replace(/^\//, '');
201+
}
202+
196203
let appFilePath = stripLeadingSlash(this.app.options.outputPaths.app.js);
197204
let finalFastbootTree = new Concat(processExtraTree, {
198205
outputFile: appFilePath.replace(/\.js$/, '-fastboot.js')
@@ -327,8 +334,6 @@ module.exports = {
327334
},
328335

329336
postBuild(result) {
330-
let appFilePath = stripLeadingSlash(this.app.options.outputPaths.app.js);
331-
this._appendAppBoot(result.directory, appFilePath);
332337
if (this.fastboot) {
333338
// should we reload fastboot if there are only css changes? Seems it maynot be needed.
334339
// TODO(future): we can do a smarter reload here by running fs-tree-diff on files loaded
@@ -356,14 +361,4 @@ module.exports = {
356361

357362
return checker.for('ember', 'bower');
358363
},
359-
360-
_appendAppBoot(appDir, appFilePath) {
361-
let env = this.app.env;
362-
let config = this.project.config(env);
363-
const isModuleUnification = (typeof this.project.isModuleUnification === 'function') && this.project.isModuleUnification();
364-
const appBoot = fastbootAppModule(config.modulePrefix, JSON.stringify(config.APP || {}), isModuleUnification);
365-
366-
appFilePath = path.resolve(appDir, appFilePath);
367-
fs.appendFileSync(appFilePath, appBoot);
368-
}
369364
};

lib/utilities/fastboot-app-module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function fastbootAppModule(prefix, configAppAsString, isModuleU
1212
return [
1313
"",
1414
"if (typeof FastBoot === 'undefined') {",
15-
" if (typeof runningTests === 'undefined' || !runningTests) {",
15+
" if (!runningTests) {",
1616
" require('{{MODULE_PREFIX}}/" + appSuffix + "')['default'].create({{CONFIG_APP}});",
1717
" }",
1818
"}",

yarn.lock

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -609,33 +609,28 @@
609609
"@simple-dom/document@^1.4.0":
610610
version "1.4.0"
611611
resolved "https://registry.yarnpkg.com/@simple-dom/document/-/document-1.4.0.tgz#af60855f957f284d436983798ef1006cca1a1678"
612-
integrity sha512-/RUeVH4kuD3rzo5/91+h4Z1meLSLP66eXqpVAw/4aZmYozkeqUkMprq0znL4psX/adEed5cBgiNJcfMz/eKZLg==
613612
dependencies:
614613
"@simple-dom/interface" "^1.4.0"
615614

616615
"@simple-dom/interface@^1.4.0":
617616
version "1.4.0"
618617
resolved "https://registry.yarnpkg.com/@simple-dom/interface/-/interface-1.4.0.tgz#e8feea579232017f89b0138e2726facda6fbb71f"
619-
integrity sha512-l5qumKFWU0S+4ZzMaLXFU8tQZsicHEMEyAxI5kDFGhJsRqDwe0a7/iPA/GdxlGyDKseQQAgIz5kzU7eXTrlSpA==
620618

621619
"@simple-dom/parser@^1.4.0":
622620
version "1.4.0"
623621
resolved "https://registry.yarnpkg.com/@simple-dom/parser/-/parser-1.4.0.tgz#b1fee1a23f48a37d6bdd98f5242db0cab5b67abc"
624-
integrity sha512-TNjDkOehueRIKr1df416qk9ELj+qWuVVJNIT25y1aZg3pQvxv4UPGrgaDFte7dsWBTbF3V8NYPNQ5FDUZQ8Wlg==
625622
dependencies:
626623
"@simple-dom/interface" "^1.4.0"
627624

628625
"@simple-dom/serializer@^1.4.0":
629626
version "1.4.0"
630627
resolved "https://registry.yarnpkg.com/@simple-dom/serializer/-/serializer-1.4.0.tgz#98470f357f418d72b1a1ec78d68191e60aefe215"
631-
integrity sha512-mI1yRahsVs8atXLiQksineDsFEFqeG7RHwnnBTDOK6inbzl4tZQgjR+Z7edjgIJq5j5RhZvwPI6EuCji9B3eQw==
632628
dependencies:
633629
"@simple-dom/interface" "^1.4.0"
634630

635631
"@simple-dom/void-map@^1.4.0":
636632
version "1.4.0"
637633
resolved "https://registry.yarnpkg.com/@simple-dom/void-map/-/void-map-1.4.0.tgz#f15f07568fe1076740407266aa5e6eac249bc78c"
638-
integrity sha512-VDhLEyVCbuhOBBgHol9ShzIv9O8UCzdXeH4FoXu2DOcu/nnvTjLTck+BgXsCLv5ynDiUdoqsREEVFnoyPpFKVw==
639634

640635
"@sindresorhus/is@^0.14.0":
641636
version "0.14.0"
@@ -3909,10 +3904,9 @@ fast-sourcemap-concat@^1.4.0:
39093904
source-map-url "^0.3.0"
39103905
sourcemap-validator "^1.1.0"
39113906

3912-
3907+
fastboot-express-middleware@^2.0.0:
39133908
version "2.0.0"
39143909
resolved "https://registry.yarnpkg.com/fastboot-express-middleware/-/fastboot-express-middleware-2.0.0.tgz#3cb2c4b744e738a709b4336c4166f1a059ab0ffb"
3915-
integrity sha512-sJHZrHpo/8jh56t+DTzaDcg6cnHbmXlTSAdfhRZbBa8XDY3TfN+TjHsHd4Z7vouLFU+ISuaZkzKfwGwipW5xwQ==
39163910
dependencies:
39173911
chalk "^2.0.1"
39183912
fastboot "^2.0.1"
@@ -3928,7 +3922,6 @@ fastboot-transform@^0.1.3:
39283922
fastboot@^2.0.0, fastboot@^2.0.1:
39293923
version "2.0.1"
39303924
resolved "https://registry.yarnpkg.com/fastboot/-/fastboot-2.0.1.tgz#f8fc0d14379e69a250045708f58268c98943f115"
3931-
integrity sha512-NH6viW7oo8oDbWXqQ1aJNP5ey3gPYKIVBCX9ByqGxdPISXo5iOEKblyijN+HrPpbidPdQx8PNqHH8mtqo9rY/g==
39323925
dependencies:
39333926
chalk "^2.0.1"
39343927
cookie "^0.3.1"
@@ -7343,7 +7336,6 @@ rsvp@^4.6.1, rsvp@^4.7.0, rsvp@^4.8.2, rsvp@^4.8.3:
73437336
rsvp@^4.8.0:
73447337
version "4.8.5"
73457338
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
7346-
integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==
73477339

73487340
rsvp@~3.2.1:
73497341
version "3.2.1"
@@ -7556,7 +7548,6 @@ silent-error@^1.0.0, silent-error@^1.0.1, silent-error@^1.1.0:
75567548
simple-dom@^1.4.0:
75577549
version "1.4.0"
75587550
resolved "https://registry.yarnpkg.com/simple-dom/-/simple-dom-1.4.0.tgz#78ad1f41b8b70d16f82b7e0d458441c9262565b7"
7559-
integrity sha512-TnBPkmOyjdaOqyBMb4ick+n8c0Xv9Iwg1PykFV7hz9Se3UCiacTbRb+25cPmvozFNJLBUNvUzX/KsPfXF14ivA==
75607551
dependencies:
75617552
"@simple-dom/document" "^1.4.0"
75627553
"@simple-dom/interface" "^1.4.0"

0 commit comments

Comments
 (0)