Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"commit": true,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
8 changes: 8 additions & 0 deletions .changeset/funny-olives-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@macalinao/grill": minor
"@macalinao/dataloader-es": minor
"@macalinao/solana-batch-accounts-loader": minor
"@macalinao/wallet-adapter-compat": minor
---

Force republish
5 changes: 5 additions & 0 deletions .changeset/purple-kings-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@macalinao/grill": minor
---

Refactor transaction sending
9 changes: 9 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ bun run ci:publish # Publish packages to npm
cd apps/example-dapp
bun run dev # Start Vite dev server
bun run build # Build the app

# IMPORTANT: After making code changes
bun run build # Build to check for TypeScript errors
bun run lint:fix # Fix linting and formatting issues
```

## Architecture
Expand Down Expand Up @@ -106,6 +110,11 @@ Provides two contexts:
- **Use double quotes for strings** (not single quotes)
- Follow default Prettier settings

### After Making Code Changes
**Always run these commands to ensure code quality:**
1. `bun run build` - Check for TypeScript errors
2. `bun run lint:fix` - Fix linting and formatting issues

### React Components
- Small, focused components
- Use function components with hooks
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Grill - Modern Solana Development Kit

[![npm version](https://img.shields.io/npm/v/@macalinao/grill.svg)](https://www.npmjs.com/package/@macalinao/grill)

A comprehensive toolkit for building Solana applications with React, featuring automatic account batching and caching.

## Packages
Expand Down Expand Up @@ -128,4 +130,4 @@ Apache-2.0

## Author

Ian Macalinao <ian@macalinao.com>
Ian Macalinao <me@ianm.com>
8 changes: 8 additions & 0 deletions apps/example-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"private": true,
"version": "0.0.0",
"type": "module",
"description": "Example Solana dApp demonstrating Grill features",
"author": "Ian Macalinao <[email protected]>",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/macalinao/grill.git",
"directory": "apps/example-dapp"
},
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
Expand Down
11 changes: 11 additions & 0 deletions apps/example-dapp/src/components/layout/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ export const MainLayout: FC<MainLayoutProps> = ({ className }) => {
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
<NavigationMenuItem>
<a
href="https://github.com/macalinao/grill"
target="_blank"
rel="noopener noreferrer"
>
<NavigationMenuLink className="group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50">
GitHub
</NavigationMenuLink>
</a>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/example-dapp/src/routes/examples/wrapped-sol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const WrappedSOLPage: FC = () => {
setWrapAmount("");
} catch (error) {
console.error("Error wrapping SOL:", error);
// Error already handled by sendTX toast
// Error already handled by mutation
} finally {
setIsWrapping(false);
}
Expand Down Expand Up @@ -135,7 +135,7 @@ const WrappedSOLPage: FC = () => {
console.log("Transaction:", explorerLink);
} catch (error) {
console.error("Error closing wSOL account:", error);
// Error already handled by sendTX toast
// Error already handled by mutation
} finally {
setIsClosing(false);
}
Expand Down
1 change: 0 additions & 1 deletion devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
packages = with pkgs; [
git
nixfmt-rfc-style
biome
];

languages.javascript = {
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"private": true,
"type": "module",
"license": "Apache-2.0",
"author": "Ian Macalinao <[email protected]>",
"repository": {
"type": "git",
"url": "git+https://github.com/macalinao/grill.git"
},
"workspaces": {
"packages": [
"packages/*",
Expand Down Expand Up @@ -36,7 +41,7 @@
"changeset:version": "changeset version",
"changeset:publish": "changeset publish",
"ci:version": "changeset version && bun update",
"ci:publish": "changeset publish",
"ci:publish": "for dir in packages/*; do (cd \"$dir\" && bun publish || true); done && changeset tag",
"prepare": "husky",
"codegen": "turbo run codegen"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/dataloader-es/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @macalinao/dataloader-es

[![npm version](https://img.shields.io/npm/v/@macalinao/dataloader-es.svg)](https://www.npmjs.com/package/@macalinao/dataloader-es)

A modern ESM-native TypeScript implementation of Facebook's [DataLoader](https://github.com/graphql/dataloader) pattern for efficient batching and caching of data loading operations.

## Description
Expand Down
13 changes: 11 additions & 2 deletions packages/dataloader-es/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"name": "@macalinao/dataloader-es",
"version": "0.1.0",
"description": "ESM-native DataLoader implementation for efficient batching and caching",
"description": "Modern ESM-native TypeScript implementation of Facebook's DataLoader pattern for efficient batching and caching",
"type": "module",
"author": "Ian Macalinao <[email protected]>",
"homepage": "https://github.com/macalinao/grill",
"homepage": "https://grill.ianm.com",
"license": "MIT",
"keywords": [
"dataloader",
"batching",
"caching",
"graphql",
"esm",
"typescript",
"performance"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
Expand Down
2 changes: 2 additions & 0 deletions packages/grill/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @macalinao/grill

[![npm version](https://img.shields.io/npm/v/@macalinao/grill.svg)](https://www.npmjs.com/package/@macalinao/grill)

Modern Solana development kit for React applications with automatic account batching, caching, and transaction notifications.

## Features
Expand Down
14 changes: 14 additions & 0 deletions packages/grill/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"name": "@macalinao/grill",
"version": "0.1.0",
"description": "Modern Solana development kit for React applications with automatic account batching, caching, and transaction notifications",
"license": "Apache-2.0",
"author": "Ian Macalinao <[email protected]>",
"homepage": "https://grill.ianm.com",
"keywords": [
"solana",
"react",
"blockchain",
"web3",
"dataloader",
"batching",
"caching",
"gill"
],
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/grill/src/contexts/grill-context.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { DataLoader } from "@macalinao/dataloader-es";
import type { Address, EncodedAccount } from "@solana/kit";
import { createContext, useContext } from "react";
import type { TransactionStatusEventCallback } from "../types.js";
import type { SendTXFunction } from "../utils/internal/create-send-tx.js";

/**
* Context value interface for SolanaAccountProvider.
Expand All @@ -10,12 +10,12 @@ import type { TransactionStatusEventCallback } from "../types.js";
export interface GrillContextValue {
/** DataLoader instance for batching and caching Solana account requests */
accountLoader: DataLoader<Address, EncodedAccount | null>;
reloadAccounts: (addresses: Address[]) => Promise<void>;
refetchAccounts: (addresses: Address[]) => Promise<void>;

/**
* Internal callback for sending transaction status events.
* Function to send transactions with batching and confirmation
*/
internal_onTransactionStatusEvent: TransactionStatusEventCallback;
sendTX: SendTXFunction;
}

/**
Expand Down
Loading