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

Breaking: Rename events to be more specific #104

Merged
merged 2 commits into from Apr 30, 2019
Merged

Breaking: Rename events to be more specific #104

merged 2 commits into from Apr 30, 2019

Conversation

phated
Copy link
Member

@phated phated commented Apr 25, 2019

@sttk While working on #103, I realized that I want to emit more events and thought it makes more sense to namespace them inside Liftoff. What do you think about these changes?

@phated phated requested a review from sttk April 25, 2019 14:28
Copy link
Contributor

@sttk sttk left a comment

Choose a reason for hiding this comment

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

@phated I've reviewed! There is one comment but it's not necessary.
And there is no other to be pointed out. Great!

@@ -457,13 +457,13 @@ Hacker.on('beforeRequire', function (name) {
});
```

#### require(name, module)
#### `on('preload:success', function(name, module) {})`

Emitted when a module has been pre-loaded.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a comment for this and preload:failure that these events are emitted for a module specified by opts.require?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should rename 'require' to 'preload'?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. That's good!

Copy link
Member Author

Choose a reason for hiding this comment

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

@sttk on a related node, what happens with node's --require flag? Why don't we respawn if that is present? Docs: https://nodejs.org/dist/latest-v10.x/docs/api/cli.html#cli_r_require_module

Copy link
Contributor

Choose a reason for hiding this comment

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

Because --require is not a v8 option but node flag. If --require flag is specified to flaggedRespawn as 3rd argument, it respawns.

Copy link
Contributor

@sttk sttk left a comment

Choose a reason for hiding this comment

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

@phated I've reviewed. Please correct some comments. Other than that, there is no problem.

@@ -446,24 +446,24 @@ A function called after your application is executed. When invoked, `this` will

Copy link
Contributor

Choose a reason for hiding this comment

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

L396, L404 and L439 are forgotten.

@@ -483,7 +483,39 @@ Hacker.on('requireFail', function (name, err) {
});
Copy link
Contributor

Choose a reason for hiding this comment

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

L481 is forgotten.

README.md Outdated

```js
var Hacker = new Liftoff({name:'hacker', require:'coffee-script'});
var Hacker = new Liftoff({name:'hacker', preload:'coffee-script'});
Hacker.on('beforeRequire', function (name) {
Copy link
Contributor

Choose a reason for hiding this comment

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

L455 is forgotten.

@@ -41,12 +41,12 @@ describe('registerLoader', function() {
var extensions = { '.conf': ['xxx', loaderPath] };

Copy link
Contributor

Choose a reason for hiding this comment

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

L37, L54 and L82 are forgotten.

@phated
Copy link
Member Author

phated commented Apr 28, 2019

@sttk I believe I've addressed everything I missed.

@sttk
Copy link
Contributor

sttk commented Apr 29, 2019

@phated Perfect! I think this is all good!

@phated phated merged commit e7a969d into master Apr 30, 2019
@phated phated deleted the event-names branch November 22, 2021 21:11
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.

None yet

2 participants