Skip to content

Commit

Permalink
Merge pull request #713 from dnalagatla/dnalagatla/reverting-embroide…
Browse files Browse the repository at this point in the history
…r-support-706

Revert embroider related updates to fix #706
  • Loading branch information
kratiahuja authored Jul 18, 2019
2 parents 408b42f + a82a966 commit 3e93733
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
25 changes: 10 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ function getVersionChecker(context) {
return checker;
}

function stripLeadingSlash(filePath) {
return filePath.replace(/^\//, '');
}


/*
* Main entrypoint for the Ember CLI addon.
Expand Down Expand Up @@ -108,6 +106,11 @@ module.exports = {
return "<!-- EMBER_CLI_FASTBOOT_TITLE --><!-- EMBER_CLI_FASTBOOT_HEAD -->";
}

if (type === 'app-boot') {
const isModuleUnification = (typeof this.project.isModuleUnification === 'function') && this.project.isModuleUnification();
return fastbootAppModule(config.modulePrefix, JSON.stringify(config.APP || {}), isModuleUnification);
}

// if the fastboot addon is installed, we overwrite the config-module so that the config can be read
// from meta tag/directly for browser build and from Fastboot config for fastboot target.
if (type === 'config-module') {
Expand Down Expand Up @@ -193,6 +196,10 @@ module.exports = {
registry: this._appRegistry
});

function stripLeadingSlash(filePath) {
return filePath.replace(/^\//, '');
}

let appFilePath = stripLeadingSlash(this.app.options.outputPaths.app.js);
let finalFastbootTree = new Concat(processExtraTree, {
outputFile: appFilePath.replace(/\.js$/, '-fastboot.js')
Expand Down Expand Up @@ -327,8 +334,6 @@ module.exports = {
},

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

return checker.for('ember', 'bower');
},

_appendAppBoot(appDir, appFilePath) {
let env = this.app.env;
let config = this.project.config(env);
const isModuleUnification = (typeof this.project.isModuleUnification === 'function') && this.project.isModuleUnification();
const appBoot = fastbootAppModule(config.modulePrefix, JSON.stringify(config.APP || {}), isModuleUnification);

appFilePath = path.resolve(appDir, appFilePath);
fs.appendFileSync(appFilePath, appBoot);
}
};
2 changes: 1 addition & 1 deletion lib/utilities/fastboot-app-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function fastbootAppModule(prefix, configAppAsString, isModuleU
return [
"",
"if (typeof FastBoot === 'undefined') {",
" if (typeof runningTests === 'undefined' || !runningTests) {",
" if (!runningTests) {",
" require('{{MODULE_PREFIX}}/" + appSuffix + "')['default'].create({{CONFIG_APP}});",
" }",
"}",
Expand Down
11 changes: 1 addition & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -609,33 +609,28 @@
"@simple-dom/document@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@simple-dom/document/-/document-1.4.0.tgz#af60855f957f284d436983798ef1006cca1a1678"
integrity sha512-/RUeVH4kuD3rzo5/91+h4Z1meLSLP66eXqpVAw/4aZmYozkeqUkMprq0znL4psX/adEed5cBgiNJcfMz/eKZLg==
dependencies:
"@simple-dom/interface" "^1.4.0"

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

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

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

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

"@sindresorhus/is@^0.14.0":
version "0.14.0"
Expand Down Expand Up @@ -3909,10 +3904,9 @@ fast-sourcemap-concat@^1.4.0:
source-map-url "^0.3.0"
sourcemap-validator "^1.1.0"

[email protected]:
fastboot-express-middleware@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fastboot-express-middleware/-/fastboot-express-middleware-2.0.0.tgz#3cb2c4b744e738a709b4336c4166f1a059ab0ffb"
integrity sha512-sJHZrHpo/8jh56t+DTzaDcg6cnHbmXlTSAdfhRZbBa8XDY3TfN+TjHsHd4Z7vouLFU+ISuaZkzKfwGwipW5xwQ==
dependencies:
chalk "^2.0.1"
fastboot "^2.0.1"
Expand All @@ -3928,7 +3922,6 @@ fastboot-transform@^0.1.3:
fastboot@^2.0.0, fastboot@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/fastboot/-/fastboot-2.0.1.tgz#f8fc0d14379e69a250045708f58268c98943f115"
integrity sha512-NH6viW7oo8oDbWXqQ1aJNP5ey3gPYKIVBCX9ByqGxdPISXo5iOEKblyijN+HrPpbidPdQx8PNqHH8mtqo9rY/g==
dependencies:
chalk "^2.0.1"
cookie "^0.3.1"
Expand Down Expand Up @@ -7343,7 +7336,6 @@ rsvp@^4.6.1, rsvp@^4.7.0, rsvp@^4.8.2, rsvp@^4.8.3:
rsvp@^4.8.0:
version "4.8.5"
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==

rsvp@~3.2.1:
version "3.2.1"
Expand Down Expand Up @@ -7556,7 +7548,6 @@ silent-error@^1.0.0, silent-error@^1.0.1, silent-error@^1.1.0:
simple-dom@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/simple-dom/-/simple-dom-1.4.0.tgz#78ad1f41b8b70d16f82b7e0d458441c9262565b7"
integrity sha512-TnBPkmOyjdaOqyBMb4ick+n8c0Xv9Iwg1PykFV7hz9Se3UCiacTbRb+25cPmvozFNJLBUNvUzX/KsPfXF14ivA==
dependencies:
"@simple-dom/document" "^1.4.0"
"@simple-dom/interface" "^1.4.0"
Expand Down

0 comments on commit 3e93733

Please sign in to comment.