Skip to content

async generator-based processing#1

Merged
jarrodconnolly merged 6 commits intomainfrom
streamless
Dec 26, 2025
Merged

async generator-based processing#1
jarrodconnolly merged 6 commits intomainfrom
streamless

Conversation

@jarrodconnolly
Copy link
Owner

This pull request refactors the compiler pipeline to use async generator-based processing instead of Node.js streams, improves error handling and source mapping in the AST generation, and updates the documentation to reflect these architectural changes. The changes make the codebase more modular, easier to debug, and better suited for incremental and asynchronous processing.

Compiler Pipeline Refactor:

  • Refactored Preprocessor, Tokenizer, and BabelAST classes to use async generator-based processing instead of Node.js streams, removing dependencies on Transform and pipeline. This enables incremental, push-like data flow and simplifies the architecture. (lib/preprocessing/preprocessor.js, lib/babel-ast/babel-ast.js, lib/compiler.js) [1] [2] [3] [4] [5] [6] [7] [8]

  • Updated the test suite to use the new async generator-based pipeline, ensuring all tests run through the refactored system. (lib/babel-ast/babel-ast.test.js)

AST Generation and Error Handling Improvements:

  • Added detailed source location (loc) metadata to all generated Babel AST nodes, improving debugging and supporting better source mapping. (lib/babel-ast/babel-ast.js) (F53df441L110R110, [1] [2] [3] [4] [5] [6] [7]

  • Enhanced error messages in AST generation to include line and column information, and replaced stream-based error handling with direct exceptions for clarity. (lib/babel-ast/babel-ast.js, lib/babel-ast/babel-ast.test.js) [1] [2] [3] [4]

Documentation Updates:

  • Updated README.md to describe the new async generator-based architecture and clarify the incremental, modular design of the compiler pipeline. (README.md) [1] [2]

These changes collectively modernize the codebase, improve maintainability, and lay the groundwork for future enhancements such as better debugging, optimization passes, and support for additional backends.

@jarrodconnolly jarrodconnolly merged commit 1a648ed into main Dec 26, 2025
1 check passed
@jarrodconnolly jarrodconnolly deleted the streamless branch December 26, 2025 02:07
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