Skip to content

[v1][breaking] Remove deprecated top-level constructors (deprecated.go) #104

@robbyt

Description

@robbyt

Summary

The 12 legacy top-level constructors in deprecated.go were superseded by the generic polyscript.New[E] constructor introduced in PR #103 (closes #84). They should be removed at the v1 cut once downstream users have had a release cycle to migrate.

Scope

Remove deprecated.go and deprecated_test.go entirely:

  • FromRisorFile, FromRisorFileWithData, FromRisorString, FromRisorStringWithData
  • FromStarlarkFile, FromStarlarkFileWithData, FromStarlarkString, FromStarlarkStringWithData
  • FromExtismFile, FromExtismFileWithData, FromExtismBytes, FromExtismBytesWithData

Each function is already annotated with a // Deprecated: doc comment pointing to the New[E] equivalent, so SA1019 will flag any remaining caller.

When

Land just before tagging v1.0.0. Do not land before there's been at least one minor release cycle on v0.x with the deprecation notices visible — gives downstream code reviews and IDE warnings a chance to fire.

Files

  • deprecated.go — DELETE
  • deprecated_test.go — DELETE
  • .golangci.yml — drop the *_test.go SA1019 exemption block (no longer needed)
  • README — drop the trailing sentence about the older constructors still working
  • polyscript.go package doc — already only references New[E]; double-check

Migration notes for users

The mapping is mechanical:

// Before
polyscript.FromRisorString(script, handler)

// After
polyscript.New[polyscript.Risor](
    polyscript.FromString(script),
    polyscript.WithLogHandler[polyscript.Risor](handler),
)

(The handler arg can be omitted entirely now that #85 makes it optional.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions