Skip to content

Also emit 'file' event for files with syntax errors #146

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

Merged
merged 1 commit into from
Mar 28, 2018

Conversation

goto-bus-stop
Copy link
Member

Previously, parseDeps emitted an error event when there was a syntax
error, and then returned undefined. Inside persistentCacheFallback(),
then, the callback would not be called. This used to be OK but the
persistent cache changes in v6 changed the callback, so now it is
responsible for 'file' and 'error' events.

This patch changes parseDeps to throw instead of emit an error. This
bubbles up to persistentCacheFallback() where it is caught and passed
to the callback. Then that callback will first emit a 'file' event for
the file and only then emit the 'error' event.

This makes watchify aware of the file, so it will watch it and rebuild
when it changes. Fixes #144 (really this time!)

Previously, `parseDeps` emitted an error event when there was a syntax
error, and then returned undefined. Inside `persistentCacheFallback()`,
then, the callback would not be called. This used to be OK but the
persistent cache changes in v6 changed the callback, so now _it_ is
responsible for 'file' and 'error' events.

This patch changes `parseDeps` to throw instead of emit an error. This
bubbles up to `persistentCacheFallback()` where it is caught and passed
to the callback. Then that callback will first emit a 'file' event for
the file and only then emit the 'error' event.

This makes watchify aware of the file, so it will watch it and rebuild
when it changes. Fixes #144 (really this time!)
Copy link
Member

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

perffff

@goto-bus-stop goto-bus-stop merged commit 0872567 into master Mar 28, 2018
@goto-bus-stop
Copy link
Member Author

📦 6.0.2

@goto-bus-stop goto-bus-stop deleted the fix/syntax-file-event branch May 16, 2018 11:38
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.

2 participants