flow icon indicating copy to clipboard operation
flow copied to clipboard

Update & improve Cadence onboarding tutorials and best practices docs

Open psiemens opened this issue 3 years ago • 8 comments

Context

The Cadence tutorials (e.g. https://docs.onflow.org/cadence/tutorial/01-first-steps) were originally written almost a year ago. Cadence has changed a lot since then! It's time to update them to be demonstrative of modern Cadence.

Definition of Done

The following should be addressed for each tutorial listed below:

  • Code is updated to be compatible with the latest Cadence version (syntax errors and semantic errors are corrected)
  • Code is updated to better demonstrate idiomatic Cadence (when applicable)
  • Where needed, tutorial instructions are updated for clarity or to remove outdated references

Tutorials:

psiemens avatar Jan 29 '21 23:01 psiemens

@10thfloor Where are the automated tests for the tutorials located? Probably would be good to include something in this ticket for making sure those get updated with the latest code too and are still passing.

@robmyers Do you feel good enough about the kitty items marketplace contract that you could use that as the marketplace tutorial instead of what we currently have?

joshuahannan avatar Feb 01 '21 16:02 joshuahannan

Two things were reported that I can think off:

  • UFix64 constructor is called for number literals that are already inferred to be UFix64 (now; they didn't use to. BTW: negative fixed-point literals are inferred to Fix64), e.g. UFix64(1.0) -> 1.0
  • No need to force-unwrap the result of getCapability calls anymore, the result is now non-optional.

turbolent avatar Feb 01 '21 17:02 turbolent

Luckily this is right place to discuss this, right now we have the ft tutorial placed after the nft tutorial, is that intended to be that way?

alilloig avatar Jul 21 '22 17:07 alilloig

@alilloig yes that was intentional after the recent tutorials audit

joshuahannan avatar Jul 21 '22 17:07 joshuahannan

When we update the two remaining tutorials it will be nice to update the links (e.g. https://docs.onflow.org/cadence/tutorial/07-marketplace-setup/ is actually the 5th tutorial now, not the 7th)

alilloig avatar Jul 21 '22 19:07 alilloig

Actually, the link is correct. The title and sidebar for the tutorials is wrong there. Marketplace setup should be the 7th tutorial, marketplace the 8th tutorial, composable the 9th, and voting the 10th. Can you update those also?

joshuahannan avatar Jul 21 '22 21:07 joshuahannan

Yeah that's true, I'll update it! I'm assuming I only need to update the title field on the .mdx files, that is correct?

alilloig avatar Jul 22 '22 18:07 alilloig

You'll also need to update the gatsby-config file in the onflow/flow repo

joshuahannan avatar Jul 22 '22 19:07 joshuahannan