-
Notifications
You must be signed in to change notification settings - Fork 878
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
Pino browser fixes #650
Pino browser fixes #650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@davidmarkclements Not that I'm a reviewer or anything, but what do you think about adding a comment to |
@@ -162,7 +162,6 @@ pino.levels = { | |||
} | |||
|
|||
pino.stdSerializers = stdSerializers | |||
pino.symbols = require('./lib/symbols') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a fear that this makes this change semver-major.
I would prefer it not to be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep. But I think this is a case of semver purity vs practicality. polyfilling symbols is extra overhead and not fully possible (e.g. typeof symbol). There is only one use case, and it's technically server side - so I think an argument can be made in this case for considering the breaking of browser compat a bug, and removing this to be the solution to that bug. Since this change along with the hapi-pino change will literally affect no one, as there are no other cases for pino.symbols in the browser.
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. |
fixes #647 and #649
NOTE: MERGE and RELEASE hapijs/hapi-pino#79 FIRST
In #612 we added symbols to browser pino.
This is breaking backward compatibility, and rather than add additional bytes for a polyfill to the payload overhead that was already added by including all symbols I think we should remove the symbols from the browser as they were only included for a "very niche use case" in #612.
We can instead update hapi-pino to use Symbol.for since the serializers symbol is a global symbol.
This also includes the smallest possible polyfill for
globalThis
for a standard-compliant cross platform global, see #649 (comment)