Skip to content

docs: Add leo 3.5 to 4.0 migration guide#572

Merged
mohammadfawaz merged 2 commits intomasterfrom
mitchmindtree/3.5-to-4.0
Mar 19, 2026
Merged

docs: Add leo 3.5 to 4.0 migration guide#572
mohammadfawaz merged 2 commits intomasterfrom
mitchmindtree/3.5-to-4.0

Conversation

@mitchmindtree
Copy link
Contributor

@mitchmindtree mitchmindtree commented Mar 17, 2026

This PR adds a comprehensive migration guide covering all breaking changes between Leo 3.5 and 4.0: function keywords (transition/function/inline -> fn), async/finalize -> final, Future -> Final, .await() -> .run(), script removal, @test fn usage, module-level struct conventions, and the program block as interface boundary.

Include quick reference table, code examples for each migration pattern, and notes on new 4.0 features (interfaces, inclusive ranges).

Updates guides overview to link the new guide.

Follow-up

Cover all breaking changes: function keywords (transition/function/inline
→ fn), async/finalize → final, Future → Final, .await() → .run(),
script removal, @test fn usage, module-level struct conventions, and the
program block as interface boundary. Include quick reference table, code
examples for each migration pattern, and notes on new 4.0 features
(interfaces, inclusive ranges).
@mitchmindtree mitchmindtree requested review from a team and AleoAlexander March 17, 2026 06:09
@mitchmindtree mitchmindtree force-pushed the mitchmindtree/3.5-to-4.0 branch from 3d3e0e8 to e7cde40 Compare March 17, 2026 06:23
@mohammadfawaz mohammadfawaz added the documentation Improvements or additions to documentation label Mar 17, 2026
JoshuaBatty
JoshuaBatty previously approved these changes Mar 18, 2026
Copy link
Collaborator

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good to me. would be interesting to load up some 3.5 Leo examples and see if this MD file as a prompt successfully migrates them all to 4.0 or if there were any edge cases it might not have had enough context for.

`final fn` was incorrectly presented as a direct replacement for
`async function`. The actual replacement is a `final { }` block,
which the compiler lifts into a standalone on-chain finalization.
`final fn` is a new compile-time code reuse mechanism that inlines
into the caller's finalization block.
Copy link
Collaborator

@mohammadfawaz mohammadfawaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thank you for this. I think this is sufficient for users to learn how to migrate their code.

@mohammadfawaz mohammadfawaz merged commit f53a426 into master Mar 19, 2026
2 checks passed
@mohammadfawaz mohammadfawaz deleted the mitchmindtree/3.5-to-4.0 branch March 19, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants