Skip to content

Conversation

@rami3l
Copy link
Contributor

@rami3l rami3l commented Jun 9, 2025

No description provided.

@peter-jerry-ye-code-review
Copy link

peter-jerry-ye-code-review bot commented Jun 9, 2025

Function generic syntax has been updated from `fn name[T]` to `fn[T] name`

Category
Maintainability
Code Snippet
Before: pub fn Value::cast_from[T](value : T) -> Value
After: pub fn[T] Value::cast_from(value : T) -> Value
Recommendation
This appears to be a consistent change across the codebase. Ensure all similar functions are updated to use the new generic syntax fn[T] name.
Reasoning
The syntax change seems to be part of language evolution for better readability and consistency. Having generics before the function name makes the type parameters more prominent.

Async type signatures now use explicit `async` keyword

Category
Correctness
Code Snippet
Before: fn async_all[T](Array[() -> T!]) -> Array[T]!
After: async fn[T] async_all(Array[async () -> T!]) -> Array[T]!
Recommendation
Review all async function calls to ensure they properly use the new async keyword in function types
Reasoning
The explicit async keyword makes it clearer which functions are asynchronous and helps prevent misuse of async functions in synchronous contexts

Removal of deprecated async operations improves code clarity

Category
Maintainability
Code Snippet
Removed file: src/js/async_deprecated.mbt
Recommendation
Update any remaining code that might still use the old async APIs to use Promise directly
Reasoning
Removing deprecated code reduces maintenance burden and prevents usage of outdated patterns. The Promise-based API appears to be the new standard way to handle async operations.

@rami3l rami3l changed the title style: reformat codebase feat(async)!: remove deprecated APIs Jun 9, 2025
@rami3l rami3l merged commit c3b3592 into main Jun 9, 2025
4 checks passed
@rami3l rami3l deleted the x/style branch June 9, 2025 07:09
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.

2 participants