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

Underscore internal methods that are public #2100

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joelhawksley
Copy link
Member

We have plenty of internal methods that are not meant to be used externally, often tagged @Private. In a recent office hours, @camertron, @BlakeWilliams and I noted that we should better indicate when an internal method should not be dependended on. I've done so here by adding a __vc_ prefix as is convention in other parts of the codebase already.

As a separate exercise, we should probably re-evaluate our public API surface area and see if we can make any public methods private.

We have plenty of internal methods that are not meant to be
used externally, often tagged @Private. In a recent office hours,
@camertron, @BlakeWilliams and I noted that we should better
indicate when an internal method should not be dependended on.
I've done so here by adding a `__vc_` prefix as is convention
in other parts of the codebase already.

As a separate exercise, we should probably re-evaluate our public
API surface area and see if we can make any public methods private.
@joelhawksley joelhawksley marked this pull request as draft September 25, 2024 22:28
Copy link
Contributor

@camertron camertron left a comment

Choose a reason for hiding this comment

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

Looks ok to me, but should we target this change for v4.0 since we're technically changing the public API?

test/sandbox/test/rendering_test.rb Show resolved Hide resolved
@joelhawksley joelhawksley marked this pull request as ready for review September 26, 2024 16:19
@joelhawksley
Copy link
Member Author

@camertron I'm torn. These APIs are not documented publicly, so I'm leaning towards this not being a breaking change.

@camertron
Copy link
Contributor

Yeah I hear you... I worry that we're going against semver by doing this though. Even though the methods in question aren't documented, they're still public, and semver is pretty clear about needing a major bump for API changes.

@BlakeWilliams
Copy link
Contributor

I could totally see someone using compile and a few of the other methods for some reason so I tend to agree @camertron.

I think hiding the compiler like this makes a ton of sense though. I'd opt for v4, personally.

@joelhawksley joelhawksley mentioned this pull request Oct 16, 2024
36 tasks
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