Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

knaeckeKami
Copy link
Collaborator

Summary

  • Refactored allocator pattern to use Code.scope for deferred allocation
  • Added configurable formatting support with dart_style 3.0.0
  • Updated to support build 3.0.0

Breaking Changes

  • gql_code_builder 0.15.0: Removed allocator parameter from public APIs
    • buildSchema() no longer takes allocator parameter
    • buildVarLibrary() no longer takes allocator parameter
    • nullAwareJsonSerializerClass() no longer takes allocator parameter
    • Other internal functions also updated

Key Changes

Allocator Refactoring

  • Replaced direct allocator usage with Code.scope((allocate) => ...) pattern
  • Allocation now deferred until final code emission stage via DartEmitter
  • Improves separation of concerns and makes code more testable

Formatting Support

  • Added dartFormatter() configuration function
  • Support for custom page_width and language_version in build.yaml
  • All builders now receive configured DartFormatter instance
  • Example configuration:
format:
  page_width: 80
  language_version: '3.7.0'

Version Updates

  • gql_code_builder: 0.14.0 → 0.15.0 (breaking changes)
  • gql_build: 0.12.0 → 0.13.0 (new features)

Test Plan

All existing tests pass. The generated code output remains functionally identical, with only formatting differences based on dart_style 3.0.0.

@knaeckeKami knaeckeKami force-pushed the feat/allocator-formatting-refactor branch from 00bd13c to 15bbfdb Compare August 24, 2025 02:02
…nerate code

- Added format config (page_width: 80, language_version: 3.6.0) to all builders
- Regenerated code with consistent formatting across all builders
- Ensures all generated files use the same formatting settings
- Remove unused config.dart import from ast_builder.dart
- Remove unused element.dart import from serializer_builder.dart (only element2.dart is used)
@knaeckeKami knaeckeKami merged commit c9d1346 into master Aug 24, 2025
21 checks passed
@knaeckeKami knaeckeKami deleted the feat/allocator-formatting-refactor branch August 24, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant