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

cue: some deprecation notices suggest other APIs which are also deprecated #1735

Closed
errordeveloper opened this issue May 26, 2022 · 3 comments

Comments

@errordeveloper
Copy link

cue/cue/build.go

Lines 60 to 61 in 87408d7

// Deprecated: use Parse or ParseBytes. The use of Instance is being phased out.
func (r *hiddenRuntime) Compile(filename string, source interface{}) (*Instance, error) {

cue/cue/build.go

Lines 104 to 106 in 87408d7

// Deprecated: use CompileString or CompileBytes. The use of Instance is being
// phased out.
func (r *hiddenRuntime) Parse(name string, source interface{}) (*Instance, error) {

@errordeveloper errordeveloper added NeedsInvestigation Triage Requires triage/attention labels May 26, 2022
@mvdan mvdan added Documentation NeedsFix and removed NeedsInvestigation Triage Requires triage/attention labels May 26, 2022
@mvdan mvdan changed the title docs for one deprecated functions point at another deprecated function cue: some deprecation notices suggest other APIs which are also deprecated May 26, 2022
@myitcv
Copy link
Member

myitcv commented Jun 2, 2022

I'm not quite sure what the issue/question is here?

cue.Runtime is deprecated, and cue.Instance is being phased, and replaced entirely by cue.Value.

The doc comments you have quoted are not, to my knowledge, visible by virtue of being defined against hiddenRuntime.

So it this perhaps just a code-level clean up you're proposing?

@errordeveloper
Copy link
Author

errordeveloper commented Jul 4, 2022

The doc comments you have quoted are not, to my knowledge, visible by virtue of being defined against hiddenRuntime.

Each of the functions are still exported. I was able to see these in vscode via code completion. I found it hard to follow the recursive deprecation.
Are you saying that these functions are not visible at pkg.go.dev or in certiain IDEs?

@mvdan
Copy link
Member

mvdan commented May 21, 2024

Are you saying that these functions are not visible at pkg.go.dev or in certiain IDEs?

They are indeed hidden from the docs, e.g. see https://pkg.go.dev/cuelang.org/go/cue@master#Runtime.

That said, we can fix up the deprecation notices to directly point to non-deprecated APIs. I'll send a patch.

cueckoo pushed a commit that referenced this issue May 21, 2024
In APIs like Runtime.Compile, point to non-deprecated alternatives,
rather than pointing to methods which are themselves also deprecated.

While here, tidy up other deprecated notes so that they use doc links.

Also note that Instance.LookupField had two deprecation notices;
only the second seems to have been up to date.

Fixes #1735.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ie8d8ba3e76855f36d3746a1e65c9d8af17737dbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants