8000 Organize deprecated APIs by bobzhang · Pull Request #2300 · moonbitlang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Organize deprecated APIs #2300

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

bobzhang
Copy link
Contributor

Summary

  • move deprecated APIs into per-package deprecated.mbt
  • rename bigint_deprecated.mbt to bigint/deprecated.mbt
  • update main sources to remove deprecated definitions
  • keep public interface the same

Testing

  • moon check
  • moon test
  • moon bundle
  • moon info

https://chatgpt.com/codex/tasks/task_e_6854d5c9baac8320ba981d430ff35c2e

Copy link
Consistent file structure for deprecated APIs

Category
Maintainability
Code Snippet
Moving deprecated APIs into dedicated deprecated.mbt files
Recommendation
Consider also adding a README.md or CHANGELOG.md to document when these APIs will be removed
Reasoning
While moving deprecated code to separate files improves maintainability, documenting the deprecation timeline helps users plan migrations

Deprecation reasons are not consistently formatted

Category
Correctness
Code Snippet
#deprecated("Use get instead.")
#deprecated("use get instead")
Recommendation
Standardize deprecation message format:

  1. Start with capital letter
  2. End with period
  3. Use consistent backtick style for code references
    Reasoning
    Consistent message formatting improves readability and professionalism of deprecation notices
Some deprecated functions lack alternatives in documentation

Category
Maintainability
Code Snippet
#deprecated
pub fn[T, U] pair(x : T, y : U) -> (T, U)
Recommendation
Always provide migration path in deprecation message:
#deprecated("Use tuple constructor (x, y) directly instead")
Reasoning
Clear migration paths help users update their code and understand the preferred alternatives

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 7393

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.886%

Totals Coverage Status
Change from base Build 7391: 0.0%
Covered Lines: 8505
Relevant Lines: 9462

💛 - Coveralls

@bobzhang bobzhang merged commit c91791b into main Jun 20, 2025
16 checks passed
@bobzhang bobzhang deleted the codex/group-deprecated-functions-into-deprecated.mbt branch June 20, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0