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

[UI Framework] Spawn compileCss as a child process to prevent a node-sass fatal error from killing the watch process #13222

Merged
merged 6 commits into from Aug 1, 2017

Conversation

Projects
None yet
2 participants
@cjcenizal
Contributor

cjcenizal commented Jul 31, 2017

No description provided.

cjcenizal added some commits Jul 31, 2017

Show outdated Hide outdated package.json
@cjcenizal

This comment has been minimized.

Show comment
Hide comment
@cjcenizal

cjcenizal Jul 31, 2017

Contributor

@tylersmalley I've addressed your feedback. Can you take another look?

Contributor

cjcenizal commented Jul 31, 2017

@tylersmalley I've addressed your feedback. Can you take another look?

const debouncedCompile = debounce(() => {
// Compile the SCSS in a separate process because node-sass throws a fatal error if it fails
// to compile.
grunt.util.spawn({

This comment has been minimized.

@tylersmalley

tylersmalley Aug 1, 2017

Member

If you wanted to use a promise here you could as well, but I feel the callback is fine if you want to leave it.

const spawn = promisify(grunt.util.spawn);

...

spawn({
  cmd: isPlatformWindows ? '.\\node_modules\\.bin\\grunt.cmd' : './node_modules/.bin/grunt',
  args: [ 'uiFramework:compileCss' ]
}).then(grunt.log.writeln).catch(e => grunt.log.error(e.stdout));
@tylersmalley

tylersmalley Aug 1, 2017

Member

If you wanted to use a promise here you could as well, but I feel the callback is fine if you want to leave it.

const spawn = promisify(grunt.util.spawn);

...

spawn({
  cmd: isPlatformWindows ? '.\\node_modules\\.bin\\grunt.cmd' : './node_modules/.bin/grunt',
  args: [ 'uiFramework:compileCss' ]
}).then(grunt.log.writeln).catch(e => grunt.log.error(e.stdout));
@tylersmalley

One minor request to use promisify.

@cjcenizal

This comment has been minimized.

Show comment
Hide comment
@cjcenizal

cjcenizal Aug 1, 2017

Contributor

@tylersmalley When I implemented your change, the output in the terminal lost some of its color, and the "bell" also didn't ring when there was an error:

image

Here's how it looked before:

image

Any suggestions on what's going on here and how we can get this behavior back?

Contributor

cjcenizal commented Aug 1, 2017

@tylersmalley When I implemented your change, the output in the terminal lost some of its color, and the "bell" also didn't ring when there was an error:

image

Here's how it looked before:

image

Any suggestions on what's going on here and how we can get this behavior back?

cjcenizal added some commits Aug 1, 2017

@cjcenizal

This comment has been minimized.

Show comment
Hide comment
@cjcenizal

cjcenizal Aug 1, 2017

Contributor

Good catch! Fixed. Thanks.

Contributor

cjcenizal commented Aug 1, 2017

Good catch! Fixed. Thanks.

@tylersmalley

LGTM - not sure why promisify is dropping the colors and bell. Got the same results with Node 8's util.promisify. This works fine.

@cjcenizal cjcenizal merged commit 08719cd into elastic:master Aug 1, 2017

1 of 2 checks passed

kibana-ci Build started sha1 is merged.
Details
CLA Commit author has signed the CLA
Details

@cjcenizal cjcenizal deleted the cjcenizal:bug/ui-framework-build-error branch Aug 1, 2017

cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Aug 1, 2017

[UI Framework] Spawn compileCss as a child process to prevent a node-…
…sass fatal error from killing the watch process (elastic#13222)

* Spawn compileCss as a child process to prevent a node-sass fatal error from killing the watch process.
* Document tasks.

cjcenizal added a commit that referenced this pull request Aug 1, 2017

[UI Framework] Spawn compileCss as a child process to prevent a node-…
…sass fatal error from killing the watch process (#13222) (#13271)

* Spawn compileCss as a child process to prevent a node-sass fatal error from killing the watch process.
* Document tasks.

snide added a commit to snide/kibana that referenced this pull request Aug 2, 2017

[UI Framework] Spawn compileCss as a child process to prevent a node-…
…sass fatal error from killing the watch process (elastic#13222) (elastic#13271)

* Spawn compileCss as a child process to prevent a node-sass fatal error from killing the watch process.
* Document tasks.

@cjcenizal cjcenizal added v6.1.0 and removed v6.0.0-rc1 labels Aug 11, 2017

cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Aug 11, 2017

[UI Framework] Spawn compileCss as a child process to prevent a node-…
…sass fatal error from killing the watch process (elastic#13222)

* Spawn compileCss as a child process to prevent a node-sass fatal error from killing the watch process.
* Document tasks.

cjcenizal added a commit that referenced this pull request Aug 11, 2017

[UI Framework] Spawn compileCss as a child process to prevent a node-…
…sass fatal error from killing the watch process (#13222) (#13476)

* Spawn compileCss as a child process to prevent a node-sass fatal error from killing the watch process.
* Document tasks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment