Skip to content

Conversation

alecgibson
Copy link
Collaborator

@alecgibson alecgibson commented Mar 28, 2024

When running ShareDB in a browser environment, we have to polyfill the util library.

However, we only use the inherits part of that library.

This change will attempt to fall back to the browser-friendly inherits library if util can't be found, allowing for lighter polyfilling.

@coveralls
Copy link

coveralls commented Mar 28, 2024

Coverage Status

coverage: 97.42% (-0.08%) from 97.503%
when pulling bf8e735 on inherits
into 5259d0e on master.

@alecgibson alecgibson changed the title ➕ Add dependency on inherits ♻️ Try loading 'inherits' library if 'util' is missing Mar 28, 2024
When running ShareDB in a browser environment, we have to polyfill the
`util` library.

However, we only use the `inherits` part of that library.

This change will attempt to fall back to the browser-friendly
[`inherits` library][1] if `util` can't be found, allowing for lighter
polyfilling.

[1]: https://github.com/isaacs/inherits
@alecgibson alecgibson merged commit 5d88b87 into master Apr 2, 2024
@alecgibson alecgibson deleted the inherits branch April 2, 2024 16:21
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.

3 participants