Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make insertion happen as a broccoli plugin. #16

Merged
merged 1 commit into from
Aug 29, 2016

Conversation

nathanhammond
Copy link
Contributor

@nathanhammond nathanhammond commented Aug 26, 2016

@nathanhammond nathanhammond force-pushed the broccoli-inserter branch 6 times, most recently from 71b798b to a6487c6 Compare August 26, 2016 21:41
@nathanhammond nathanhammond changed the title [WIP] Make insertion happen as a broccoli plugin. Make insertion happen as a broccoli plugin. Aug 26, 2016
@nathanhammond
Copy link
Contributor Author

No longer a WIP.

@stefanpenner if you can review the new Broccoli plugin I'd appreciate it.

}

if (fs.existsSync(indexFilePath)) {
var index = metaReplacer(fs.readFileSync(indexFilePath, { encoding: 'utf8'}), manifest);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: space after 'utf8' and can we break this into two lines? Probably:

var indexFile = fs.readFileSync(...);
var indexWithManifest = metaReplacer(indexFile, manifest);

Similar for the testIndex below.

@nathanhammond nathanhammond force-pushed the broccoli-inserter branch 4 times, most recently from 7329bcc to 3bf72e0 Compare August 28, 2016 01:28
@nathanhammond
Copy link
Contributor Author

Now supports arbitrary index names making it "more correct."

@trentmwillis
Copy link
Member

@nathanhammond can you rebase this? Should fix the SauceLabs issue. Quick review doesn't show any major issues, will review and likely merge tomorrow assuming Sauce passes.

@nathanhammond nathanhammond force-pushed the broccoli-inserter branch 2 times, most recently from f8fbe65 to 2092b48 Compare August 28, 2016 21:26
@nathanhammond
Copy link
Contributor Author

All set.

console.warn('\n\nWarning: Unable to read asset-manifest.json from build with error: ' + error)
console.warn('Warning: Proceeding without generated manifest; you will need to manually provide a manifest to the Asset Loader Service to load bundles at runtime. If this was intentional you can turn this message off via the `noManifest` flag.\n\n');
manifest = { bundles: {} };
if (assetLoaderOptions && assetLoaderOptions.noManifest) {
Copy link
Member

Choose a reason for hiding this comment

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

We can probably change this to be before we generate the asset manifest (likely worthy of another PR since this is the current behavior).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I call dibs on you doing it. 😜

@trentmwillis
Copy link
Member

Some small comments. Once the above are addressed this is good to land.

@nathanhammond nathanhammond force-pushed the broccoli-inserter branch 2 times, most recently from 8d8e678 to d7fbf04 Compare August 29, 2016 20:03
@trentmwillis trentmwillis merged commit 68399ac into ember-engines:master Aug 29, 2016
@nathanhammond nathanhammond deleted the broccoli-inserter branch August 30, 2016 00:34

AssetManifestInserter.prototype.build = function() {
var sourceDir = this.inputPaths[0];
var manifestFilePath = path.join(sourceDir, 'asset-manifest.json');
Copy link
Contributor

@stefanpenner stefanpenner Sep 6, 2016

Choose a reason for hiding this comment

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

it seems like there are only 3 inputs that matter, yet the current usage will assume a rebuild is required if any of the inputs changes, also it will always taint the output even if the output has not changed.

I suspect we don't want either of these behaviors.

Copy link
Member

@trentmwillis trentmwillis Sep 6, 2016

Choose a reason for hiding this comment

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

@stefanpenner can you work with @nathanhammond to optimize this?

Edit: or provide some guidance on how to rectify and I'll take a stab eventually

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants