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

Add pino-browser support for hapi-pino #612

Merged
merged 2 commits into from
Mar 20, 2019
Merged

Add pino-browser support for hapi-pino #612

merged 2 commits into from
Mar 20, 2019

Conversation

lidel
Copy link
Contributor

@lidel lidel commented Mar 19, 2019

This PR updates browser.js to expose/stub symbols and serializer methods expected by hapi-pino.

Without this, TypeError happens here and here.

This is useful in extremely niche use case when one wants to run code with embedded Hapi (HTTP server) in browser context enriched with chrome.sockets APIs (such as Chrome Apps or blessed extensions in Chromium-based browsers).

In my case, to run js-ipfs (with embedded hapi) in WebExtension context: ipfs/ipfs-companion#664 / ipfs/ipfs-companion#716

This changes browser.js to expose symbols and serializer methods used
by hapi-pino.

This is extremely niche use case, but some people want to run Hapi.js
(HTTP server) in WebExtension context using chrome.sockets APIs.

Ref. ipfs/ipfs-companion#664

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@mcollina
Copy link
Member

Can you add unit test?

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel
Copy link
Contributor Author

lidel commented Mar 20, 2019

@mcollina Added, coverage is 100% again.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollina mcollina merged commit 7d2ba19 into pinojs:master Mar 20, 2019
mcollina pushed a commit to hapijs/hapi-pino that referenced this pull request Apr 27, 2019
Switch to pino v5.12.3  which includes
fix from pinojs/pino#612

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
davidmarkclements added a commit to hapijs/hapi-pino that referenced this pull request May 14, 2019
@github-actions
Copy link

github-actions bot commented Feb 5, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants