You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue proposes a significant refactor of the library, transitioning from the current function prototype-based approach to a modern TypeScript and ES6 class-based architecture. The primary motivation behind this change is to improve the library's maintainability, scalability, and overall developer experience.
Current Problems
Inherent Limitations of Prototypal Inheritance: The current function prototype inheritance model can become complex and cumbersome, especially as the codebase grows and new features are added. It often leads to deeply nested object structures and a less intuitive understanding of the code.
Lack of Static Typing (JavaScript): Without static typing, we rely on runtime checks to catch errors, which can lead to unexpected issues in production. TypeScript's static type system would help prevent these problems at compile time.
Readability and Maintainability Concerns: The prototype-based code can be less readable and harder to reason about than the structured class approach, potentially hindering future development and maintenance efforts.
Proposed Solution
TypeScript Adoption: We will migrate the entire codebase to TypeScript. This will introduce static typing, enabling us to catch errors early, improve code quality, and enhance developer productivity through code autocompletion and better tooling.
ES6 Class Conversion: We will refactor all existing functions and prototype-based objects into ES6 classes. This change will provide a more organized and structured approach to code organization, making the codebase easier to understand, maintain, and extend.
Modular Code Structure: Currently, a lot of code is written based on ES5. It's worth writing with ES6 syntax to aid understanding and maintenance.
The text was updated successfully, but these errors were encountered:
I am working on creating some products around ComfyUI. I have already implemented many parts of it in my code using TypeScript. I'd like to contribute to this project. If no other one is working or has a plan to do this.
Some sections were intentionally ignored because they're unused, have not been maintained, and are likely targets for pruning. There are also more expect-error directives than I'd like, but the vast majority are in or related to the same ignored sections.
Whilst there's clean up to do in many places, and rewrites in others, all the boxes are finally ticked for this issue.
Description
This issue proposes a significant refactor of the library, transitioning from the current function prototype-based approach to a modern TypeScript and ES6 class-based architecture. The primary motivation behind this change is to improve the library's maintainability, scalability, and overall developer experience.
Current Problems
Inherent Limitations of Prototypal Inheritance: The current function prototype inheritance model can become complex and cumbersome, especially as the codebase grows and new features are added. It often leads to deeply nested object structures and a less intuitive understanding of the code.
Lack of Static Typing (JavaScript): Without static typing, we rely on runtime checks to catch errors, which can lead to unexpected issues in production. TypeScript's static type system would help prevent these problems at compile time.
Readability and Maintainability Concerns: The prototype-based code can be less readable and harder to reason about than the structured class approach, potentially hindering future development and maintenance efforts.
Proposed Solution
TypeScript Adoption: We will migrate the entire codebase to TypeScript. This will introduce static typing, enabling us to catch errors early, improve code quality, and enhance developer productivity through code autocompletion and better tooling.
ES6 Class Conversion: We will refactor all existing functions and prototype-based objects into ES6 classes. This change will provide a more organized and structured approach to code organization, making the codebase easier to understand, maintain, and extend.
Modular Code Structure: Currently, a lot of code is written based on ES5. It's worth writing with ES6 syntax to aid understanding and maintenance.
The text was updated successfully, but these errors were encountered: