Skip to content

[Meta] Strict mode, deprecations, lifetime #353

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 8 commits into from
Jun 13, 2025
Merged

Conversation

Mr3zee
Copy link
Collaborator

@Mr3zee Mr3zee commented Jun 12, 2025

Subsystem
All

Strict mode Migration
A series of changes to simplify kRPC protocol

  • Remove fields support
  • Remove stream scopes
  • Simplify lifetime management
  • Cold RPC clients creation
  • Deprecated declarations cleanup
  • Documentation update for previous changes

@Mr3zee Mr3zee self-assigned this Jun 12, 2025
@Mr3zee Mr3zee added breaking Contains breaking changes deprecation Contains derecations labels Jun 12, 2025
@Mr3zee Mr3zee marked this pull request as ready for review June 12, 2025 10:34
@Mr3zee Mr3zee requested a review from e5l June 12, 2025 10:34
@Mr3zee Mr3zee force-pushed the enforce-strict-mode branch from 4ff5335 to 6bb54a8 Compare June 12, 2025 14:43
@Mr3zee
Copy link
Collaborator Author

Mr3zee commented Jun 12, 2025

Tests pass on CI

@e5l e5l requested a review from Copilot June 13, 2025 07:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the kRPC protocol by removing deprecated features and streamlining strict mode checks and lifetime management. Key changes include removal of fields support and deprecated strict mode components, refactoring of diagnostics, and elimination of outdated CLI options.

Reviewed Changes

Copilot reviewed 271 out of 271 changed files in this pull request and generated no comments.

Show a summary per file
File Description
compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt Updated strict mode checkers by removing the obsolete context parameter.
compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt Removed the deprecated supertype generator.
compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/checkers/diagnostics/DiagnosticFactories.kt Adjusted diagnostics mapping for updated strict mode messages.
compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcStrictModeClassChecker.kt Updated strict mode checker calls to align with the new API.
compiler-plugin/compiler-plugin-cli/src/main/latest/kotlinx/rpc/codegen/RpcCompilerPlugin.kt Removed CLI options related to strict mode configuration.
compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/ServiceDeclaration.kt Removed fields support from service declarations.
compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt Removed unused IR properties no longer needed after the deprecations.
compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt Replaced field handling with a runtime error due to removal of fields support.
Comments suppressed due to low confidence (3)

compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt:68

  • The removal of the 'ctx' parameter in the strict mode class checker is a significant API change; please verify that all diagnostics and related functionality operate correctly without it.
class FirRpcStrictModeClassCheckerVS : FirRegularClassChecker(MppCheckerKind.Common) {

compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt:1

  • The deprecated FirRpcSupertypeGenerator has been completely removed; ensure that any remaining references to this generator in project configurations or documentation are updated accordingly.
File removed

compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt:49

  • [nitpick] Since support for fields has been removed from @rpc services, consider if a compile-time check might be preferable over throwing a runtime error to enhance the developer experience.
error("Fields are not supported in @Rpc services, this error should be caught by frontend. Please report this issue to the kotlinx-rpc maintainers.")

@Mr3zee Mr3zee merged commit df7b1ce into main Jun 13, 2025
8 of 9 checks passed
@Mr3zee Mr3zee deleted the enforce-strict-mode branch June 13, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Contains breaking changes deprecation Contains derecations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants