Skip to content

Instantly share code, notes, and snippets.

View airhorns's full-sized avatar
🎯
Workin' on Gadget at https://gadget.dev

Harry Brundage airhorns

🎯
Workin' on Gadget at https://gadget.dev
View GitHub Profile
@airhorns
airhorns / llms.txt
Created May 14, 2025 13:24
Gadget llms.txt
# Overview
- Gadget is a full-stack application development and hosting platform. It provides developers with all of the tools needed to build, debug, deploy, host and scale apps, under one roof
- Gadget is used to build web applications in Javascript or Typescript. It is suitable for any project whose frontend or backend can be coded in Javascript or Typescript
- While Gadget apps can be full-stack, they don't necessarily need to be. Often the platform is used for projects without a frontend (e.g.integrating two APIs to automate data flow)
- The purpose of Gadget is to help developers deploy projects 100x faster (than with other tools) by building an end-to-end experience that rids the developer of undifferentiated work like infrastructure setup, glue code, CRUD APIs and all forms of other repetitive work
- Gadget accomplishes this purpose by offering an experience that couples the language, tooling, infrastructure, and boilerplate features and exposes them to the developer through a framework that saves ti

Computed views (Beta)

Computed views are read-only queries that return data from your backend for customized use cases beyond the normal find and findMany API calls. Computed views can filter, transform, and aggregate data from many records, which makes them useful for building things like dashboards, leaderboards, reports, and other custom queries.

Beta availability

Computed views are supported in Gadget framework version 1.4 and later, or if you've been given the beta by a member of the Gadget staff

Computed views requires the @gadgetinc/react package version 0.21.0 or later

Filtering Shopify webhooks

Shopify allows you to filter the events that trigger a webhook for your application. There's two ways to filter webhooks in Shopify:

  • limit which records are delivered to your app, which you can do with a webhook filter
  • limit which fields of each record are delivered to your app, which you can do with an includeFields list

Both of these strategies can be used individually or together to limit the number of webhook Shopify sends to your app, and lower your total Gadget compute time.

Webhook filters

diff --git a/dist/traceable.cjs b/dist/traceable.cjs
index e28a67a3d8a5ad543aff6a565c9fd93824b6bc31..3981c280d572d671de3bd202504feb1f4cd0c7d6 100644
--- a/dist/traceable.cjs
+++ b/dist/traceable.cjs
@@ -377,20 +377,25 @@ function traceable(wrappedFunc, config) {
});
return tappedStream;
}
- async function* wrapAsyncIteratorForTracing(iterator, snapshot) {
+ async function* wrapAsyncGeneratorForTracing(iterable, snapshot) {
/**
* Bigtable schema layout for concurrency ticket managment
* One key per queue shard to store the current list of holders, like `holders#<some-hash>#e:environmentId#q:queueName#s:shard`
* - queue id is the row key
* - shard id that splits up high concurrency queues for one tenant into many different shards, currently running with shards of size 20, so a tenant with 200 max conurrency gets 10 shards
* - `agg:holderCount` column containing the number of current holders
* - dynamic columns per current holder, using the particpant id as the column qualifier, having the workflowid as a value
* - hash is added up front to ensure that shards for the same tenant with correlated load go to different tablets
*
* One key per requester to store the list of waiting tickets, like `req#<some-hash>#e:environmentId#q:queueName#s:shard#priorityScore#enqueuedTimestamp#requesterId`
/* eslint-disable no-console */
import type { AgentAction, AgentFinish } from "@langchain/core/agents";
import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
import type { Document } from "@langchain/core/documents";
import type { Serialized } from "@langchain/core/load/serializable";
import {
AIMessage,
AIMessageChunk,
BaseMessage,
ChatMessage,
// what would be really annoying to do
const result = await gpt4oMini.withConfig({callbacks: [BraintrustCallbackHandler]}).withStructuredOutput( //...
// what would be much better
export const gpt4oMini = new ChatOpenAI({
model: "gpt-4o-mini",
callbacks: [BraintrustCallbackHandler],
...retryConfig,
});
const strictSchemaCache = new WeakMap<ZodSchema, ZodSchema>();
const strictZodSchema = (schema: ZodSchema): ZodSchema => {
if (schema instanceof ZodObject) {
const shape = schema.shape;
const newShape: any = {};
for (const key in shape) {
const fieldSchema = shape[key];
if (key == "default" && fieldSchema instanceof ZodOptional && fieldSchema.unwrap() instanceof ZodAny) {
continue;
function toast(text, delay){
var div = document.createElement("div");
div.style.position = "fixed";
div.style.maxWidth = "80%";
div.style.color = "white";
div.style.boxSizing = "border-box";
div.style.background = "rgba(0,0,0,0.76)";
div.style.padding = "0.8em 2.618em";
div.style.bottom = '9%';
div.style.left = '3%';
rip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs" "--ld-path=/nix/store/cg869jlpzrh5xgc0hcll7risc5gsk611-mold-2.1.0/bin/mold"
> = note: clang-11: error: unsupported option '--ld-path=/nix/store/cg869jlpzrh5xgc0hcll7risc5gsk611-mold-2.1.0/bin/mold'
>
>
> error: could not compile `jsonpath_lib` (lib) due to previous error
> warning: build failed, waiting for other jobs to finish...