@typegraph/sdk
Advanced tools
Changelog
v0.4.8 - 2024-08-16
I discover an issue in the KV runtime documentation kvruntime docs
</details> <details > <summary> `wasm_backtrace` config bug (<a href="https://github.com/metatypedev/metatype/pull/814">#814</a>) </summary>$WASM_BACKTRACE_DETAILS
was enabled in main
ghjk env which
affected embedded wasm module compilation to have backtrace enabled.
This broke typegate runs without the flag enabled due to mismatch....
Changelog
v0.4.7 - 2024-08-08
lade-sdk
uses the main branch, which now has the fix for the
following issues:url
is set at <2.5.0
;...
...
How to test your typegraphs
documentationNo Migrations Needed
New Features
Updated the Minio service to the latest version for improved performance and potential new features.
Introduced comprehensive documentation for testing typegraphs in both TypeScript and Python, enhancing developer experience.
Documentation
Meta CLI
upgrade instructions.Reformatted installation instructions for the typegraph
package for
better clarity.
Chores
Updated dependency management configuration for improved compatibility and performance across different platforms.
...
Changelog
v0.4.6 - 2024-08-01
...
...
New Features
Introduced new logging capabilities in the ConnectedEngine
with
adjustable logging levels.
Implemented cleanup procedures in tests to enhance resource management.
Bug Fixes
Fixed import paths for permissions to ensure correct functionality in tests and applications.
Version Updates
Incremented version numbers across multiple projects and packages to reflect ongoing development and improvements.
Documentation
Added comments to clarify code behavior and potential future considerations in various modules.
Refactor
Optimized string handling in several functions and adjusted method signatures for improved clarity and efficiency.
quick-start
page...
Changelog
v0.4.5 - 2024-07-18
Fixes erroneous usage of setup-deno
which has been replaced by ghjk
itself.
...
Fix issue with the three remaining failing jobs.
...
...
Skip the deno stack trace from the error message when tg_manage fails.
<!-- 2. Explain WHY the change cannot be made simpler --> <!-- 3. Explain HOW users should update their code -->N/A
--retry
and
--retry-interval-ms
options.--max-parallel-loads
option has been renamed to --threads
.The --max-parallel-loads
option has been renamed to --threads
.
new branch after conflict with main branch
<!-- Pull requests are squashed and merged using: - their title as the commit message - their description as the commit body Having a good title and description is important for the users to get readable changelog. --> <!-- 1. Explain WHAT the change is about -->...
setup
whiz task to avoid issues on macosMET-614 MET-606 MET-605 MET-613
No changes required.
Changelog
v0.4.4 - 2024-07-05
Ensure that all deps are defined in import_map.json
with a specific
version.
!!code-loader!
to load code inside the
documentation (will hopefully help also with the missing typegraphs
issues, still under investigation)Demonstrate how to use the openapi spec to generate clients in most languages/frameworks.
None
Typegate
instance, to improve test
configurability.SYNC_REDIS_PASSWORD
has been removed, can only be set on the
SYNC_REDIS_URL
.
[x] The change comes with new or modified tests
[ ] Hard-to-understand functions have explanatory comments
[x] End-user documentation is updated to reflect the change
In the previous versions, we restricted the variant types allowed in union/either to be all in the same category (after flattening multi-level unions):
Those restrictions can be lifted, and the selection field of an union-type field will have inline fragments with type conditions for each Category 2 variant. No type condition is required for Category 1 types, the selection sets are not relevant.
The case that is not handled by this PR is when one of the variants is an array of union type.
<!-- 3. Explain HOW users should update their code -->N/A
meta deploy
, enabled by
default for meta dev
.If you have a script that runs meta dev
, add the flag --no-typegate
if you already have a typegate.
typegraph_name
instead of
TypegraphOutput
obj.No Migrations Needed
...
Prepare release of the 0.4.4 version.
Try reverting back to deno runtime for the typescript sdk in hope of making the dx easier. Hosting a custom node/npm project adds more layer of indirection which may result in cryptic issues sometimes.
This should also facilitate publishing on jsr although additional work
are still required on the jco
codegen side.
N/A
build.sh
scripts due to wasm-tools EOF issuemetatypedev/setup-ghjk
for improved stability and performance.GHJK_VERSION
and various environment variables across
multiple configuration files to ensure compatibility with updated
dependencies.pyproject.toml
for better security
and performance.
These updates collectively optimize the development environment, ensuring smoother builds and more reliable workflows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->New test runner, by default:
Parallel tests re-enabled.
<!-- 2. Explain below WHY the change cannot be made simpler --> <!-- 3. Explain below WHY the was made or link an issue number --> <!-- 4. Explain HOW users should update their code or remove that section -->N/A
<!-- 5. Readiness checklist - [ ] The change come with new or modified tests - [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --> </details>Changelog
v0.4.3 - 2024-06-22
Fix example typegraphs on metatype.dev.
No Migrations Needed
No Migration Needed
...
Use the xtask binary to run the tests.
New Features
x86_64-linux
.Added new configuration entry for enhanced versioning and platform support.
Improvements
Modified test script to use a custom build script for better test management.
These changes improve platform compatibility and streamline the testing process.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->Fix Missing Typegraphs
<!-- 1. Explain WHAT the change is about -->No Migrations Needed ...
The typegraphs.deno
section of the metatype.yaml
config file has
been replaced by typegraphs.typescript
and typegraphs.javascript
.
tg_deploy
params has changed.
[x] The change comes with new or modified tests
[x] Hard-to-understand functions have explanatory comments
[x] End-user documentation is updated to reflect the change
N/A
New Features
Added a "Features Roadmap" component to the website, displaying a list of features with details and links.
Documentation
Updated various guides and reference documents to improve clarity and presentation of code examples.
Added new sections for various features such as Typegate, Typegraph, Runtimes, Prisma, Auth, Tooling, and SDK.
Bug Fixes
Refactor
Replaced SDKTabs
and TabItem
components with TGExample
for
better code example presentation.
Adjusted the MiniQL
component to handle optional properties and
default settings.
/docs/reference/metagen
/docs/guides/wasm-functions
/docs/guides/external-functions
MDK-492.
...
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
.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.
Typegate
class.Chores
Blogpost to help discover programmatic deployment additions.
...
New Features
Introduced programmatic deployment feature for deploying typegraphs within the Metatype ecosystem using TypeScript/Python SDKs.
Added new configuration options and deployment functions to enhance automation and flexibility in deployment processes.
Documentation
Added a new blog post detailing the programmatic deployment feature and its usage.
PythonRuntime
deps.DenoRuntime
deps.The change includes support for declaring artifact dependencies through
globs
and dirs
In the deps
parameter for python.import(...)
and deno.import(...)
,
globs and dirs can be passed in addition to files.
New Features
Introduced functionality for defining and deploying Typegraphs for Deno and Python runtimes.
Added support for defining a Deno runtime dependency graph with policies for test scenarios.
Bug Fixes
Corrected the structure of the Deno.serve
call in the serve
function.
Refactor
Enhanced method chaining for better readability in the MetaTest
class.
Tests
Updated test coverage reporting to include new Deno runtime test files.
Chores
No Migrations Needed ...
Mdk for python runtime
None
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->New Features
Introduced new functionalities for generating Python code based on configurations, including handling of templates and required objects.
Added Python script templates for defining typed functions and structured objects with comprehensive data type handling.
Documentation
Provided detailed summaries and documentation for new functionalities and templates.
Refactor
Implemented new structures and methods for efficient code generation and type handling.
Tests
Chores
Updated URLs in the .ghjk/deno.lock
file to reflect new changes in
the codebase.
mdk_typescript
code generator for typescript type
inference on Deno runtime external modules.metatype.yaml
has changed. Targets are now lists
instead of maps, items no sporting generator
field instead of key
acting as ref to generator.fromExport
method has been renamed to export
to make it more uniform to handler.export
and handler
method's now expect
handler/func name under name
instead of func
.codegen
flag has been removed from ArtifactsConfig
object.gen mod/mdk
has been simplified to just gen
as the previous
mod option is no longer avail.Introduces a mechanism for wasm materializers to access hostgate functions.
This implements a pretty basic JSON wire interface, a singular
hostcall
function that's exposed to materializers. The only
implemented function on this interface are gql
queries.
This is a stacked PR on top of #687.
MET-473.
New Features
Added an import statement for std_url
and a new task for installing
WASI adapter related files.
Introduced new functionalities in the application's runtime to support additional parameters and error handling.
Enhancements
Improved the application's handling of GraphQL queries with new error types and display methods.
Enhanced the WASM runtime build process to target a more appropriate architecture.
Bug Fixes
Fixed issues in Python and WASM runtime tests to ensure reliability and performance.
Documentation
Updated internal documentation to reflect new command interfaces and environmental interactions in the application's CLI tools.
Refactor
Refactored various internal APIs to improve code maintainability and efficiency.
Update the implementation of t.engine()
The change comes with removing the different spin-offs of t.engine
which arose from the previous impl of t.engine incompatibility with
artifact upload protocol. The change will make t.engine
deploy the
artifacts in Artifact Resolution mode by running a shell command to
deploy the typegraph.
...
<!-- 3. Explain below WHY the was made or link an issue number --> <!-- 4. Explain HOW users should update their code or remove that section -->t.engine
t.engine
run in artifact resolution modetempDir
s to all the typegate instances
created during test.meta-test
and add multi typegraph tests.python SDK test typegraphs' function names should be the same with the filename of the typegraph file, for dynamic import compatibility reasons.
<!-- 5. Readiness checklist - [ ] The change come with new or modified tests - [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --> <!-- This is an auto-generated comment: release notes by coderabbit.ai -->New Features
Introduced a new function wasm_duplicate
to handle WebAssembly
runtimes with specific policies.
Refactor
Renamed and refactored functions and test setups to align with updated test frameworks and improve code clarity.
Bug Fixes
Added error handling in the getLocalPath
function to log warnings if
linking errors occur.
Tests
Updated test scripts to reflect changes in function calls, imports, and engine instantiation for better test accuracy and reliability.
New Features
x86_64-linux
.Introduced new functionalities for generating Python code and enhanced type management.
Added import statement for std_url
and new task for installing WASI
adapter files.
Enhanced runtime support for additional parameters and error handling.
Improvements
Enhanced GraphQL query handling with new error types and display methods.
Improved WASM runtime build process for better architecture targeting.
Documentation
Added new sections for Typegate, Typegraph, Runtimes, Prisma, Auth, Tooling, and SDK.
Bug Fixes
Materializer and function might introduce confusion as they are pretty much the same thing from the user point of view, one can be defined in terms of the other.
None
These changes enhance the readability and consistency of our documentation, making it easier for users to understand and implement the features and concepts within the system.
<!-- end of auto-generated comment: release notes by coderabbit.ai --> </details> <details > <summary> (docs) Embedded typegate (v0.3.x) blog (<a href="https://github.com/metatypedev/metatype/pull/750">#750</a>) </summary> <!-- Pull requests are squashed and merged using: - their title as the commit message - their description as the commit body Having a good title and description is important for the users to get readable changelog. -->No Migrations Needed
New Features
Introduced a new blog post on emulating server nodes locally using the Embedded Typegate feature in Meta CLI.
Added a new BlogIntro
component to the website for displaying styled
blog introductions.
Documentation
Updated documentation to explain how to spin up a local instance of Typegate for testing and development.
Chores
Updated platform compatibility from "x86_64-linux" to "aarch64-darwin".
Add reference page for g.rest(..)
None
Update deno to 1.43.6 and make requisite changes.
Required because of dep conflicts with latest lade-sdk.
update Rust dependencies
<!-- 2. Explain WHY the change cannot be made simpler --> <!-- 3. Explain HOW users should update their code -->No Migrations Needed
...
Changelog
v0.4.2 - 2024-05-22
Fix fat CLI compilation
Bump to 0.4.2
Bump wasmtime to 21
Bump rust to 1.78.0
[x] The change comes with new or modified tests
[ ] Hard-to-understand functions have explanatory comments
[ ] End-user documentation is updated to reflect the change
Changelog
v0.4.1 - 2024-05-20
BaseError
class for structured messages in responsesNew Features
Updated Docker image versions and dependency versions to ensure compatibility and stability.
Bug Fixes
Enhanced error handling with specific error classes for more detailed error messages.
Refactor
Replaced generic Error
instances with specific error classes for
better error categorization.
Refactored error handling in HTTP response functions to use a
BaseError
class.
Chores
Updated version numbers across multiple configuration files to
0.4.1-0
.
Bug Fixes
Updated Docker image version for the typegate
service to ensure
stability and compatibility.
Documentation
Revised TAGLINE
for better clarity on supported languages: WASM,
Typescript, and Python.
Updated version declarations for improved consistency and functionality across multiple files.
some changes to comparison table(docs)
No Migrations Needed
<!-- 5. Readiness checklist - [ ] The change come with new or modified tests - [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --> <!-- This is an auto-generated comment: release notes by coderabbit.ai -->TODO
comment in installation documentation.New Features
Updated platform support for better compatibility with "x86_64-linux".
Bug Fixes
Minor version updates across multiple configurations to enhance stability.
Chores
Updated version numbers from "0.4.0" to "0.4.1-0" across various files and configurations.
Refactor
Adjusted build and test scripts for improved efficiency and compatibility.
Documentation
Enhanced internal documentation to reflect version and platform changes.
Changelog
v0.4.0 - 2024-05-09
Fixes the broken nightly builds. Look at solved results here.
Nightly builds were broken due to oversight during the #571 fixes.
No changes required
Fix the NPM registry config in the Github tests.
<!-- 2. Explain below WHY the change cannot be made simpler --> <!-- 3. Explain below WHY the was made or link an issue number --> <!-- 4. Explain HOW users should update their code or remove that section -->N/A
<!-- 5. Readiness checklist - [ ] The change come with new or modified tests - [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --> </details> <details > <summary> Set max log level based on verbose flag (<a href="https://github.com/metatypedev/metatype/pull/664">#664</a>) </summary>Set max log level based on verbose flag
n/a
Fix secret passing in examples and documentation.
Followup to #666.
N/A
Fix the CSS issue introduced by docusaurus 3.2.0 (https://github.com/facebook/docusaurus/issues/10005). 3.2.1 should fix it but the affected version maybe loaded by dependencies, so we will have to wait a bit more.
<!-- Explain WHY the was made or link an issue number --> <!-- Explain HOW users should update their code when required -->Remove log level override by the verbosity flag when no flag is present. It will default to the configured env_logger default level (or env variable).
<!-- 2. Explain below WHY the change cannot be made simpler -->...
<!-- 3. Explain below WHY the was made or link an issue number -->The default log level became "error" after #664, and RUST_LOG
environment variable where ignored.
N/A
<!-- 5. Readiness checklist - [ ] The change come with new or modified tests - [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --> </details>Changing the intro.
<!-- Explain WHY the was made or link an issue number -->None.
<!-- Explain HOW users should update their code when required -->Add missing docs for tgDeploy
, tgRemove
None
Getting started with meta
cli should be easy
None
No Migration Needed
Improve /docs/tutorials/metatype-basics
No Migrations Needed
Better documentation
N/A
/guides/external-functions
page.N/A
N/A
Improves docs/reference/types
N/A
N/A
Architecture
section in docs.No Migration Needed
<!-- 5. Readiness checklist - [ ] The change come with new or modified tests - [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --> </details>Delegate serialize, deploy, undeploy, unpack work to SDK.
Remove duplicate logic, thinking of cli as a convenience on top of the SDK.
When meta cli is used, Migration files are unpacked/resolved relative to
the typegraph's path, not the process's workdir
.
Adds a command to meta-cli
to invoke metagen.
MET-424
No changes required
Enable back codegen
on current cli implementation.
None
Make it more clear where failures happen
None
Enable support for wit and facilitate readiness for the upcoming specs.
#[wasmedge_bindgen]
are replaced by wit bindings.
In the old version we were restricted to#[wasmedge_bindgen]
, which was
only available in Rust and unique to WasmEdge.
#[wasmedge_bindgen]
fn add(a: u32, b: u32) -> u32 {
a + b
}
In the new implementation, wasm modules written in any language that
uses the wit
interface are now natively supported within typegate
.
// wit/example.wit
package example:host;
world host {
export add: func(a: u32, b: u32) -> u32;
}
An implementation (eg. in Rust) may look like this..
// src/lib.rs
wit_bindgen::generate!({ world: "host" });
struct MyLib;
impl Guest for MyLib {
fn add(a: u32, b: u32) -> u32 {
a + b
}
}
export!(MyLib);
Enables the DENO_V8_FLAGS
env var for tuning v8.
MET-435 or #621
Implements the general framework for metagen including a generator for rust based wasm mat functions modules.
MET-420
No breaking changes
Set what files/folders should be ignored when using the custom
expand_path
function in an external .tgignore
file.
.tgignore
will behave similarly to most .ignore files with basic glob
syntax support.
expand_glob
has been renamed to expand_path
The mdk codegen and typegraph mutually depends on each other (typegraph
needs a concrete mdk.wasm for hashing, and for the mdk.wasm to be built,
it needs type generation based on the typegraph)
Add a flag to enable processing a partial typegraph when using meta gen
(partial == no artifact resolution).
get_file_hash
has been moved to core sdk (under the name hash_file
)
Upload protocol for wasm files and atrifacts for WasmEdge Runtime
for
single replica mode
No Migrations Needed
Console.
N/A
Store the typegraph on s3 for multiple instance support mode.
Reduce Redis data.
Environment variables:
REDIS_URL
has been removedSYNC_REDIS_URL
, SYNC_S3_HOST
, SYNC_S3_REGION
, SYNC_S3_BUCKET
,
SYNC_S3_ACCESS_KEY
, SYNC_S3_SECRET_KEY
; and the following variables
are optional: SYNC_REDIS_PASSWORD
, SYNC_S3_PATH_STYLE
. Otherwise,
none of them can be set.Remove the ability to define secrets in the env vars of the typegate.
Secrets can now only be defined in the metatype config file and the
--secret
CLI option.
secrets.<tg_name>.key
:# before
typegates:
dev:
env:
TG_CONSOLE_POSTGRES_CONN: postgresql://postgres:password@localhost:5432/db?schema=console
TG_CONSOLE_BASIC_ADMIN: password
#after
typegates:
dev:
secrets:
console:
POSTGRES_CONN: postgresql://postgres:password@localhost:5432/db?schema=console
BASIC_ADMIN: password
# before
meta deploy -f my-tg.py --secret TG_CONSOLE_POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console
# after
meta deploy -f my-tg.py --secret POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console
# or - with the typegraph name
meta deploy -f my-tg.py --secret console:POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console
The queryPrismaModel
function on the typegate typegraph queries rows
from a prisma model.
Console.
N/A
Upload artifacts to S3 when sync-mode is enabled
Sharing artifacts between replicas without including it in the typegraph (and sync through redis)
No changes needed.
Track artifact/module dependencis for PythonRuntime
python.import(...)
and python.import_(...)
accept an optional parameter deps
that accepts list of dependencies for the python module.
Persisting deno runtime artifacts to a local/shared storage.
deno.import(...)
and deno.import_(...)
accept an optional parameter
that accepts list of dependencies for the deno/ts module.
Enable batch prisma queries (and transaction) in the typegate runtime
Console
AsyncDisposable
and
AsyncDisposableStack
Typegate
objectN/A
New Features
Updated artifact storage documentation to clarify management processes.
Bug Fixes
Removed outdated Deno import mapping settings to streamline development environment setup.
Documentation
Expanded documentation on artifact tracking and management, including reference counting and garbage collection mechanisms.
Refactor
Implemented interface changes in QueryEngine
for better async
disposal management.
Code restructuring in artifact management for enhanced performance and maintainability.
Chores
Adjusted settings and configurations in the development environment to align with current best practices.
Tests
Introduced new test cases for artifact upload and management functionalities.
Bumps version to release 0.4.0.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->componentize-py
based
component.Faster build time
Make sure to sync typegate/src/types.ts
when an update is made on the
typegraph schema.
Improve the temporal runtime exposing more parameters and adding more tests.
MET-397. The old implementation was bug-ridden and did not expose necessary params.
API changes to TemporalRuntime
ctor, methods and generated
materializers.
Pass the test options in the first parameter along with the test name/description.
Avoid scrolling to the end of the test function to see/update the test options.
N/A
Use verdaccio local npm registry for tests:
@typegraph/sdk
package is published to the local npm registry,
and can now be consumed like any npm package from Nodejs or Deno....
N/A
Changelog
v0.3.6 - 2024-03-14
.apply
Typegraph is too big sometimes.
Prepare release v0.3.6
N/A
N/A