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

♻️ Try loading 'inherits' library if 'util' is missing #648

Merged
merged 1 commit into from
Apr 2, 2024

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.

package.json Outdated Show resolved Hide resolved
@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
4 of 8 checks passed
@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.

None yet

3 participants