4 ms·
It's driven by library developers wanting to prevent access to internals. I was annoyed by it initially because I love poking around in internals and it makes i
by vaughan 5y ago
It's driven by library developers wanting to prevent access to internals. I was annoyed by it initially because I love poking around in internals and it makes it easy to add missing functionality or fix bugs, but I can kind of understand from popular library maintainers.
If Bar depends on a private internal of Baz, and Foo depends on Bar, then if Baz publishes a patch version that changes an internal to fix a bug, Bar breaks, and so does Foo.
- ectopod 5y agoCan't you already hide your implementation details using a closure?
- kccqzy 5y agoYes you can. But few libraries actually do that.
- nicoburns 5y agoI think React have the right approach. If something isn't part of the committed to public API, then it's named `__unstable_foo`. Consumers of the library are free to use them, but they can and will change at the whim of the maintainers regardless of any stability guarantees that the library usually provides. This allows advanced consumers to tinker where they need to and are prepared to take on the maintenance while leaving potential complainers no leg to stand on if the API changes.