pkl-config-java: Replace Config.fromPklBinary() with ConfigDecoder#1533
Merged
bioball merged 1 commit intoapple:mainfrom Apr 20, 2026
Merged
pkl-config-java: Replace Config.fromPklBinary() with ConfigDecoder#1533bioball merged 1 commit intoapple:mainfrom
bioball merged 1 commit intoapple:mainfrom
Conversation
bioball
approved these changes
Apr 18, 2026
Member
bioball
left a comment
There was a problem hiding this comment.
LGTM! Yeah, this makes sense and gives us good symmetry with the evaluator side of things.
Looking for one more thumb before merging this.
| @@ -0,0 +1,78 @@ | |||
| /* | |||
| * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. | |||
Member
There was a problem hiding this comment.
Copyright years are per source file (new files introduced this year should have © 2026)
Suggested change
| * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. | |
| * Copyright © 2026 Apple Inc. and the Pkl project authors. All rights reserved. |
| @@ -0,0 +1,62 @@ | |||
| /* | |||
| * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. | |||
Member
There was a problem hiding this comment.
Suggested change
| * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. | |
| * Copyright © 2026 Apple Inc. and the Pkl project authors. All rights reserved. |
| @@ -0,0 +1,49 @@ | |||
| /* | |||
| * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. | |||
Member
There was a problem hiding this comment.
Suggested change
| * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. | |
| * Copyright © 2026 Apple Inc. and the Pkl project authors. All rights reserved. |
Motivation: - `Config` mixes configuration representation with decoding logic - `Config.fromPklBinary()` does not scale as decoding gains options (e.g., binary versions or formats) - The decoding API is inconsistent with `ConfigEvaluator` Changes: - Introduce `ConfigDecoder` (with builder) and move `Config.fromPklBinary()` logic into it - Deprecate `Config.fromPklBinary()` methods for removal - Add `ConfigDecoder.forKotlin()` extension function - Update and improve tests Result: - Decoding is separated from `Config` and exposed via a dedicated API - Decoding can evolve independently (e.g., adding options such as binary versions or supporting new formats) - Evaluation and decoding APIs follow a consistent design
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Configmixes configuration representation with decoding logicConfig.fromPklBinary()does not scale as decoding gains options (e.g., binary versions or formats)ConfigEvaluatorChanges:
ConfigDecoder(with builder) and moveConfig.fromPklBinary()logic into itConfig.fromPklBinary()methods for removalConfigDecoder.forKotlin()extension functionResult:
Configand exposed via a dedicated API