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

Engine initialization. #37

Merged
merged 1 commit into from Aug 16, 2015
Merged

Engine initialization. #37

merged 1 commit into from Aug 16, 2015

Conversation

@jagoda
Copy link
Contributor

jagoda commented Jul 30, 2015

Some view engines (i.e. Nunjucks) rely on the manager configuration
and other state in order to render templates. This change provides
a convenience method to allow engines to initialize any additional
state and to update the engine configuration accordingly.

@jagoda jagoda added the feature label Jul 30, 2015
@jagoda jagoda self-assigned this Jul 30, 2015
@jagoda jagoda added this to the 3.0.0 milestone Jul 30, 2015
@jagoda jagoda force-pushed the jagoda:feat-engine-init branch from b2a0e67 to 4305ca4 Aug 1, 2015
README.md Outdated
@@ -220,6 +222,9 @@ Initializes the server views manager where:
where `callback` has the signature `function(err, compiled)` where `compiled` is a
function with signature `function(context, options, callback)` and `callback` has the
signature `function(err, rendered)`.
- `prepare(config)` - initializes additional engine state.

This comment has been minimized.

Copy link
@hueniverse

hueniverse Aug 8, 2015

Member

Always blocking?

This comment has been minimized.

Copy link
@jagoda

jagoda Aug 10, 2015

Author Contributor

I see no reason that it needs to be -- I just didn't have an async example on hand. I'm happy to rework it to be optionally async (and admittedly more consistent with the rest of the API). This seems to suggest a prepareMode option if it is going to parallel the compile function. Do you have any thoughts on this approach?

This comment has been minimized.

Copy link
@hueniverse

hueniverse Aug 10, 2015

Member

compile mode was added for backwards compatibility issues. I would just do it async style and be done.

This comment has been minimized.

Copy link
@jagoda

jagoda Aug 10, 2015

Author Contributor

Cool, will do. Thanks for the input!

@jagoda jagoda force-pushed the jagoda:feat-engine-init branch from 4305ca4 to c9bac11 Aug 15, 2015
@jagoda

This comment has been minimized.

Copy link
Contributor Author

jagoda commented Aug 15, 2015

@hueniverse I'm about ready to wrap this up. However, it looks like I'm not on the list of maintainers in NPM. Would you mind adding me to that so that I can publish 3.0.0 after merging this?

Some view engines (i.e. Nunjucks) rely on the manager configuration
and other state in order to render templates. This change provides
a convenience method to allow engines to initialize any additional
state and to update the engine configuration accordingly.
@jagoda jagoda force-pushed the jagoda:feat-engine-init branch from c9bac11 to a6ef12b Aug 15, 2015
@hueniverse

This comment has been minimized.

Copy link
Member

hueniverse commented Aug 15, 2015

Done

@jagoda

This comment has been minimized.

Copy link
Contributor Author

jagoda commented Aug 16, 2015

Awesome. Thanks!

jagoda added a commit that referenced this pull request Aug 16, 2015
Engine initialization.
@jagoda jagoda merged commit 20c0d0a into hapijs:master Aug 16, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jagoda jagoda deleted the jagoda:feat-engine-init branch Aug 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.