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
15 changes: 11 additions & 4 deletions apps/docs/src/content/docs/design/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ The risk is real as we were told ["Stop using dapps"](https://decrypt.co/209804/

In the web context, dependencies make the bundle larger and the site slower. [Island Architecture](https://docs.astro.build/en/concepts/islands/) -- we try to contain comopnents into static ones as plain markups and text when possible, and limit interacitivt to speicifc componenst. This help simplify diff across versions and make a larger chunk of the dApp served by IPFS which is immutable. This also help rendering infrequently updated contnet faster, composing different frameworks in a page and encourages pushing slow operations to the server. Typically, we postpone hydration for components requiring a connected wallet.

In the context of autonomous agent, a simple package-lock.json is not sufficient to guarantee your agent keep running autonomously and safely. As dev we are just tired of [https://en.wikipedia.org/wiki/Dependency_hell].
As we argued in [Architecture](/architecture.md) the challenge is even more prominent for diverse, decentralized agents than dApps.
In the context of autonomous agent, a simple package-lock.json is not sufficient to guarantee your agent keep running autonomously and safely. As dev we are just tired of [dependency hell](https://en.wikipedia.org/wiki/Dependency_hell).
As we argued in [Architecture](/design/architecture/), the challenge is even more prominent for diverse, decentralized agents than dApps.



Expand All @@ -37,22 +37,30 @@ Many framework adopt a plugin system, some limit dependencies to only plugin bei
s
### Scenario #1

```mermaid
sequenceDiagram
Agent->>ToolPlugin: invoke
ToolPlugin-->>Dependencies: invoke
Dependencies->>Protocol: invoke
```

### Scenario #2

```mermaid
sequenceDiagram
Agent->>Agent: invoke
Agent-->>Dependencies: invoke
Dependencies->>Protocol: invoke
```


### Scenario #3

```mermaid
sequenceDiagram
Agent->ImmutableTool: invoke
ImmutableTool->>Protocol: invoke
```

Improve scenario in #2 (reduced dependencies by design and removing wrapper)
Enable Scenario #3 where common , immutable hosted on IPFS and work with Lit Action.
Expand All @@ -65,7 +73,7 @@ viem

This documents rationale behind opionated dependencies

- For graphql / store related, refers to [/data.md]
- For graphql / store related, refers to [data](/design/data)

- `vitest` over `jest`
- used by shadcn, scaffold and generally author find less issues for typscript setup as in jest.
Expand All @@ -83,4 +91,3 @@ This documents rationale behind opionated dependencies

## Form
- we opt for shadcn form (react-hook-form) instead of radix ui form

4 changes: 2 additions & 2 deletions apps/docs/src/content/docs/design/starter-kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ We want to be agnostic regarding
| Base | onchainkit | 8k | |
| Stark | [@starknet-react/core](https://www.npmjs.com/package/@starknet-react/core) | 2k | |
| XMTP | [react-xmtp](https://www.google.com/search?q=xmtp-react&oq=xmtp-react&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQLhhA0gEIMTY5N2owajGoAgCwAgA&sourceid=chrome&ie=UTF-8) | 2k | |
| EAS | [@ethereum-attestation-service/eas-sdk](@ethereum-attestation-service/eas-sdk) | 3k | |
| EAS | [@ethereum-attestation-service/eas-sdk](https://www.npmjs.com/package/@ethereum-attestation-service/eas-sdk) | 3k | |
| ENS | ensjs, react | | |
| Mina | o1js | 2k | [zkapp-cli](https://docs.minaprotocol.com/zkapps/tutorials/zkapp-ui-with-react) |
| MUD | @latticexyz/react | 3k | |
Expand All @@ -76,4 +76,4 @@ We want to be agnostic regarding


### Wagmi
- https://wagmi.sh/react/comparisons#overview
- https://wagmi.sh/react/comparisons#overview
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/guides/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ title: Installation

- You can look for components to use and identify the registry item url, then install via

- `pnpm exec shadcn@canary add https://ddev.geist.network/components/account/balance.json`
- `pnpm exec shadcn@canary add https://ddev.geist.network/components/account/balance.json`
2 changes: 2 additions & 0 deletions apps/docs/src/content/docs/guides/shadcn-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ We support using shadcn cli AS-IS to add geist components, which is deployed ont


- `shadcn add <geist-repo-url>/styles/default/identity_address-badge.json`

- Note we are still pointing default shadcn url (i.e. REGISTRY_URL) to original registry, so as to support adding components from both shadcn & geist registry

- We currently do not support adding new components out of this repository to geist registry, but you can host your own registry
Expand All @@ -21,4 +22,5 @@ We support using shadcn cli AS-IS to add geist components, which is deployed ont

## Bulking
- Note shadcn registry entry contains source code for all related components/lib/hooks, which reduce http round trip.

- Meanwhile currently it requires explicitly specifiying dependencies at e.g. register-ui.tsx over analyzing imports of the component
3 changes: 1 addition & 2 deletions apps/docs/src/content/docs/intro/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Faster: Build size is generally not the major concern given treeshaking at moder


## How is this different from Scaffold-ETH (or Scaffold-X)
- check [/starter-kit.md]
- check [starter-kit](/design/starter-kit)

## Which frameworks are supported
- Currently we focus on React with wagmi, but make it framework agnostic and support solid.js is a goal (reaplcing underlying @radix ui components) .
Expand All @@ -114,4 +114,3 @@ We're not infosec experts and precisely for that reason we do best-effort to ali
## Acknolwedgement
- Thanks shadcn released with MIT license to make this possible
- Thank you for contribution

34 changes: 19 additions & 15 deletions apps/storybook/src/stories/decorators/wallet-control.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
import { AddressBadge } from "@geist/ui-react/components/identity/address-badge";
import { privateKeyToAccount } from "viem/accounts";

// Abstracted component for the story wrapper with address badge
const StoryWrapperWithAddress = ({
address,
children,
}: { address?: string; children: React.ReactNode }) => (
<div className="w-full top-0">
<div className="float-right">
{address && <AddressBadge address={address} />}
</div>
<div className="p-10">{children}</div>
</div>
);

export const withWalletControl = () => {
return (Story: any, context: any) => {
const { privateKey } = context?.args;
const account = privateKeyToAccount(privateKey);
const { address } = account;

return (
<div>
<AddressBadge address={address} />
<div className="p-10">
<Story args={context.args} />
</div>
</div>
<StoryWrapperWithAddress address={address}>
<Story args={context.args} />
</StoryWrapperWithAddress>
);
};
};

export const withWalletControlWagmi = () => {
return (Story: any, context: any) => {
const { account } = context?.args;

const { address } = account;

return (
<div className="w-full top-0">
<div className="float-right">
{address && <AddressBadge address={address} />}
</div>
<div className="p-10">
<Story args={context.args} />
</div>
</div>
<StoryWrapperWithAddress address={address}>
<Story args={context.args} />
</StoryWrapperWithAddress>
);
};
};