Skip to content

Comments

Add YAML parsing support to WASM runtime#5785

Merged
isum merged 2 commits intomasterfrom
ion/add-yaml-parsing-support-to-wasm-runtime
Feb 11, 2025
Merged

Add YAML parsing support to WASM runtime#5785
isum merged 2 commits intomasterfrom
ion/add-yaml-parsing-support-to-wasm-runtime

Conversation

@isum
Copy link
Member

@isum isum commented Jan 31, 2025

This PR implements two host functions that are exported to WASM mappings, allowing them to easily parse YAML documents.

The main use case for this feature is to parse subgrah manifests, but it is flexible enough to allow parsing any YAML document.

Part of #5772
AssemblyScript types are defined in graphprotocol/graph-tooling#1935

Todos

  • Add WASM runtime tests
  • Open a PR in graph-tooling repo with AssemblyScript type definitions

@isum isum self-assigned this Jan 31, 2025
@isum isum marked this pull request as ready for review January 31, 2025 19:24
@fordN fordN linked an issue Feb 6, 2025 that may be closed by this pull request
2 tasks
@fordN fordN requested a review from mangas February 6, 2025 17:01
@isum isum force-pushed the ion/add-yaml-parsing-support-to-wasm-runtime branch 2 times, most recently from 169124a to c3b3ffb Compare February 10, 2025 14:42
}
}

/// For debugging, it might be useful to know exactly which bytes could not be parsed as YAML, but
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a better indication of where the error is? If so the error could be more relevant and show the part that broke. Not super important just a thought

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no straightforward way to do this nicely. All the logging context should be enough to identify the cause of a parsing error, so I will leave it as is for now

Copy link
Contributor

@mangas mangas left a comment

Choose a reason for hiding this comment

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

LGTM

@isum isum force-pushed the ion/add-yaml-parsing-support-to-wasm-runtime branch from c3b3ffb to ed04edb Compare February 11, 2025 18:24
@isum isum merged commit 82080b1 into master Feb 11, 2025
6 checks passed
@isum isum deleted the ion/add-yaml-parsing-support-to-wasm-runtime branch February 11, 2025 18:39
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.

[Feature] Native support for parsing YAML manifests in subgraphs

2 participants