# `useblocks/runtime`

Shared dependencies for the plugin system.

## What this package is

This package provides shared entrypoints for React, ReactDOM, Ant Design, and related modules.
It also exposes `useblocks/runtime/core` as the shared bridge for internal plugin-runtime singletons.

In most cases it is used for plugin bundling and shared dependencies, not as the main plugin API.

## Installation

```bash
npm install useblocks/runtime
```

## How to use it

In a regular plugin project, write normal imports:

```ts
import React from 'react';
import { Button } from 'antd';
```

If you use the CLI or ready-made templates, extra setup is usually not required.

## When to import `runtime` directly

Direct imports from `useblocks/runtime/*` are only needed when you configure the bundler manually.

Example:

```ts
import { createRoot } from 'useblocks/runtime/react-dom/client';
import { Button } from 'useblocks/runtime/antd';
```

## Available modules

| Import | Purpose |
|--------|---------|
| `useblocks/runtime/react` | React |
| `useblocks/runtime/react-dom` | React DOM |
| `useblocks/runtime/react-dom/client` | React 18 client API |
| `useblocks/runtime/react/jsx-runtime` | JSX runtime |
| `useblocks/runtime/antd` | Ant Design |
| `useblocks/runtime/core` | shared runtime bridge for internal singletons and plugin internals |

## Important

- for most plugins, normal `react` and `antd` imports are enough
- direct imports from `runtime` are only needed for manual setup
- `useblocks/runtime/core` is primarily for bundler/runtime integration, not for regular plugin authoring code
- the public plugin API lives in `useblocks-extensions-api` and `useblocks-extensions-react`
