Skip to content

Conversation

ggiraldez
Copy link
Contributor

Adds a section with standalone examples to the user guide. These examples demonstrate almost all the Slang APIs. Applies on top of #1257.

OmarTawfik and others added 8 commits February 26, 2025 08:59
- restructured the user guides around all v1 APIs
- added guides for the newly introduced parts (compilations, bindings, and versioning utils)
- added a few more examples, and a dedicated page for other projects already using Slang
- removed the (hidden/disabled) Rust examples, and replaced them with TypeScript ones
- fixed a minor bug where `QueryMatch` root cursor was not exposed via WIT
- added some clarifications to the guides about error tolerance and how we handle it
- relaxed the `noUncheckedIndexedAccess` tsconfig check, since it was adding more noise pollution to the examples than it is useful
- moved the guide examples under each guide, to make it easier to edit/review them

NOTE:

This is missing 3 examples for binding graph/builtins, that I'm adding right now. They are currently disabled with `TODO` comments. But creating the PR now since it is a large change, and it would be good to start getting feedback.
@ggiraldez ggiraldez requested a review from OmarTawfik March 7, 2025 05:22
Copy link

changeset-bot bot commented Mar 7, 2025

⚠️ No Changeset found

Latest commit: 06486ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ggiraldez ggiraldez changed the title Add more standalone examples to the user guides Add standalone examples to the user guides Mar 7, 2025
@beta-ziliani
Copy link
Contributor

beta-ziliani commented Mar 7, 2025

The "list functions" example is missing motivation. Why anyone would need to do that? One alternative I can imagine, but it overlaps with the others, is to have basic test coverage of functions. With this in mind, then the example should change to receive a target contract and a testing contract, and the output be if every public function from the target is at least referenced once in the testing contract. Does it make sense?

@beta-ziliani
Copy link
Contributor

I also add here in this section, even if duplicated, the example of the tx.origin. And frame each example from their potential use:

  • IDE support: jump to definition
  • Linting / security check
  • Code coverage

Copy link
Contributor

@stefanoban stefanoban left a comment

Choose a reason for hiding this comment

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

Thank you for adding these examples, I think they are very valuable for anyone looking into using Slang!

@OmarTawfik OmarTawfik deleted the branch NomicFoundation:user-guides March 7, 2025 14:34
@OmarTawfik OmarTawfik closed this Mar 7, 2025
@OmarTawfik
Copy link
Contributor

OmarTawfik commented Mar 7, 2025

@ggiraldez I think the PR was closed automatically by mistake when #1257 was merged 😢

@ggiraldez
Copy link
Contributor Author

@ggiraldez I think the PR was closed automatically by mistake when #1257 was merged 😢

Yeah, that's my guess as well. No worries. I'm surprised it cannot be re-opened. I thought you could edit the base branch. I'll open another one.

github-merge-queue bot pushed a commit that referenced this pull request Mar 7, 2025
Resubmitting this since #1267 was closed when #1257 was merged.

Adds a section with standalone examples to the user guide. These
examples demonstrate almost all the Slang APIs.
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.

4 participants