Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: /docs/reference/metagen + /docs/guides/wasm-functions #751

Merged
merged 4 commits into from
Jun 11, 2024

Conversation

Yohe-Am
Copy link
Contributor

@Yohe-Am Yohe-Am commented Jun 5, 2024

  • Adds /docs/reference/metagen
  • Adds /docs/guides/wasm-functions
  • Adds a codegen section to /docs/guides/external-functions

MDK-492.

Migration notes

...

  • The change comes with new or modified tests
  • Hard-to-understand functions have explanatory comments
  • End-user documentation is updated to reflect the change

Summary by CodeRabbit

  • New Features

    • Added new targets for metagen with different generators and paths for TypeScript, Python, and Rust.
    • Introduced new functionality for defining and exposing typegraphs with policies in various environments (Deno, Python, Rust).
    • Added automated Rust WebAssembly project generation and compilation script.
    • Enhanced documentation with new sections and updated code examples using TGExample.
  • Bug Fixes

    • Updated .gitignore to exclude *.wasm files.
  • Documentation

    • Updated links and added detailed instructions for generating types using metagen.
  • Refactor

    • Switched from HashMap to BTreeMap and HashSet to BTreeSet in various modules for better data structure handling.
    • Added logging enhancements in the Typegate class.
  • Chores

    • Updated build script for Rust WebAssembly target.

Copy link

linear bot commented Jun 5, 2024

MET-493 (mdk) docs

@Yohe-Am
Copy link
Contributor Author

Yohe-Am commented Jun 5, 2024

Render of new pages

image

image

image

@Yohe-Am
Copy link
Contributor Author

Yohe-Am commented Jun 5, 2024

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jun 5, 2024

Walkthrough

The changes encompass updates to .gitignore, additions of new targets in examples/metatype.yaml, and introductions of new files and functionalities across various directories, particularly for handling TypeScript, Python, and Rust environments. Key additions include new data structures, runtime configurations, and typegraph definitions, along with updates to logging, error handling, and documentation.

Changes

File(s) Change Summary
.gitignore Added exclusion for *.wasm files within the examples/typegraphs/ directory.
examples/metatype.yaml Added new targets for metagen with generators and paths for TypeScript, Python, and Rust.
examples/typegraphs/metagen-deno.py Introduced metagen_deno function, idv3 data structure, and remix_track function with Deno runtime configurations.
examples/typegraphs/metagen-deno.ts Defined typegraph with policies, struct definitions, and runtime configurations in a Deno environment.
examples/typegraphs/metagen-py.ts Defined typegraph with idv3 structure and remix_track function using Python runtime.
examples/typegraphs/metagen-rs.py Introduced metagen_rs function, idv3 data structure, and remix functionality using Wasm runtime.
examples/typegraphs/metagen-rs.ts Defined typegraph with idv3 structure and remix handler using Wasm runtime.
examples/typegraphs/metagen-sdk.py Introduced metagen_sdk function, idv3 data structure, and remix function using Deno runtime.
examples/typegraphs/metagen-sdk.ts Defined typegraph structures and exposed them using Deno runtime.
examples/typegraphs/metagen/Cargo.toml Introduced workspace configuration specifying resolver version and members.
examples/typegraphs/metagen/py/remix.py Introduced remix_track function for modifying Idv3 objects.
examples/typegraphs/metagen/py/remix_types.py Introduced module for creating structured data classes and handling typed transformations.
examples/typegraphs/metagen-rs/Cargo.toml Specified package details, dependencies, and flags for Rust WebAssembly project.
examples/typegraphs/metagen-rs/build.sh Automated generation and compilation of Rust WebAssembly project.
examples/typegraphs/metagen-rs/lib.rs Introduced mdk module, exported contents, and implemented RemixTrack for MyMat.
examples/typegraphs/metagen-rs/mdk.rs Defined interfaces and structures for metatype system, including handlers and initialization.
examples/typegraphs/metagen-ts/mdk.ts Introduced type definitions for context object, handlers, and specific data types.
examples/typegraphs/metagen-ts/remix.ts Introduced remix_track function for remixing track information.
libs/common/src/typegraph/mod.rs Switched from HashMap to BTreeMap for artifacts field in TypeMeta struct.
meta-cli/src/cli/gen.rs Added conditional check to verify existence of key in mgen_conf.targets.
meta-cli/src/logger.rs Commented out conditional compilation attribute related to setting environment variable.
typegate/src/typegate/mod.ts Added logging statements for missing engine on request URL or specific request.
typegate/tests/runtimes/wasm_wire/rust/build.sh Updated TARGET variable to wasm32-unknown-unknown.
typegraph/core/src/typegraph.rs Simplified assignment of ctx.meta.artifacts to artifacts field.
typegraph/core/src/utils/fs_host.rs Changed HashSet to BTreeSet for resolved_deps variable.
typegraph/core/src/utils/postprocess/python_rt.rs Switched import from collections::hash_map::Entry to collections::btree_map::Entry.
website/docs/concepts/features-overview/index.mdx Updated links for "Deployments," "Migrations," and "Codegen" sections.
website/docs/guides/external-functions/index.mdx Replaced CodeBlock with TGExample for code examples, updated callouts, and added section for generating types using metagen.
website/docs/guides/wasm-functions/index.mdx Introduced new guide for working with WebAssembly functions.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant CLI
    participant Metagen
    participant Target

    User->>CLI: Execute command with target
    CLI->>Metagen: Check target in configuration
    Metagen->>CLI: Return available keys (if target not found)
    CLI->>User: Error message (if target not found)

    alt Target Found
        CLI->>Target: Execute target-specific logic
        Target->>CLI: Return results
        CLI->>User: Display results
    end
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 17

Outside diff range and nitpick comments (5)
examples/typegraphs/metagen/ts/remix.ts (1)

9-9: Clarify the comment regarding S3Runtime or consider implementing it if it's part of the planned features.

typegate/tests/runtimes/wasm_wire/rust/build.sh (1)

Line range hint 8-8: The command ghjk x install-wasi-adapter appears to be incorrect. Did you mean gh install-wasi-adapter?

website/src/components/MiniQL/index.tsx (1)

Line range hint 69-69: Add missing dependencies to useMemo to ensure the component updates correctly when props change.

-  const fetcher = useMemo(
-    () =>
-      createGraphiQLFetcher({
-        url: `${tgUrl}/${typegraph}`,
-      }),
-    [],
-  );
+  const fetcher = useMemo(
+    () =>
+      createGraphiQLFetcher({
+        url: `${tgUrl}/${typegraph}`,
+      }),
+    [tgUrl, typegraph],  # Added missing dependencies
+  );
website/docs/reference/metagen/index.mdx (2)

10-12: Ensure the beta warning is prominently displayed and consider adding more details about what aspects are unstable.


16-16: Consider linking directly to the pages for the meta CLI and typegraph SDKs for user convenience.

website/docs/reference/metagen/index.mdx Show resolved Hide resolved
website/docs/guides/wasm-functions/index.mdx Outdated Show resolved Hide resolved
website/docs/guides/wasm-functions/index.mdx Show resolved Hide resolved
website/docs/guides/wasm-functions/index.mdx Outdated Show resolved Hide resolved
website/docs/reference/metagen/index.mdx Outdated Show resolved Hide resolved
examples/typegraphs/metagen/rs/build.sh Show resolved Hide resolved
examples/typegraphs/metagen-rs.py Show resolved Hide resolved
examples/typegraphs/metagen-rs.ts Show resolved Hide resolved
examples/typegraphs/metagen-sdk.ts Show resolved Hide resolved
examples/typegraphs/metagen-sdk.py Show resolved Hide resolved
zifeo
zifeo previously approved these changes Jun 5, 2024
Copy link
Member

@zifeo zifeo left a comment

Choose a reason for hiding this comment

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

An opinionated one: mdkfdk?

website/docs/reference/metagen/index.mdx Show resolved Hide resolved
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 41.17647% with 10 lines in your changes missing coverage. Please review.

Project coverage is 73.06%. Comparing base (f2b7d82) to head (2cc0dc2).
Report is 1 commits behind head on main.

Files Patch % Lines
typegate/src/typegate/mod.ts 40.00% 6 Missing ⚠️
typegate/src/runtimes/python.ts 0.00% 3 Missing ⚠️
typegate/src/sync/replicated_map.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #751      +/-   ##
==========================================
+ Coverage   72.99%   73.06%   +0.06%     
==========================================
  Files         117      116       -1     
  Lines       14181    14150      -31     
  Branches     1414     1416       +2     
==========================================
- Hits        10351    10338      -13     
+ Misses       3803     3786      -17     
+ Partials       27       26       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

michael-0acf4
michael-0acf4 previously approved these changes Jun 6, 2024
Base automatically changed from met-492-mdk-typescript to main June 10, 2024 18:29
@Yohe-Am Yohe-Am dismissed stale reviews from michael-0acf4 and zifeo June 10, 2024 18:29

The base branch was changed.

@Yohe-Am Yohe-Am force-pushed the docs/MET-493/mdk branch from 90f6de8 to 2cc0dc2 Compare June 11, 2024 11:10
@Yohe-Am Yohe-Am merged commit dc79efa into main Jun 11, 2024
12 checks passed
@Yohe-Am Yohe-Am deleted the docs/MET-493/mdk branch June 11, 2024 12:23
@coderabbitai coderabbitai bot mentioned this pull request Jan 3, 2025
3 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jan 20, 2025
3 tasks
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.

3 participants