diff --git a/website/components/back-in-block/count.tsx b/website/components/back-in-block/count.tsx
index 838b476ca6..9440ee567e 100644
--- a/website/components/back-in-block/count.tsx
+++ b/website/components/back-in-block/count.tsx
@@ -22,4 +22,4 @@ export function CountExample() {
);
-}
\ No newline at end of file
+}
diff --git a/website/components/back-in-block/slideshow.tsx b/website/components/back-in-block/slideshow.tsx
index b7f40eb2a0..ea99f2b0f7 100644
--- a/website/components/back-in-block/slideshow.tsx
+++ b/website/components/back-in-block/slideshow.tsx
@@ -51,4 +51,4 @@ export function Slideshow({
);
-}
\ No newline at end of file
+}
diff --git a/website/components/back-in-block/static-analysis.tsx b/website/components/back-in-block/static-analysis.tsx
index 22dbff1307..e17608868a 100644
--- a/website/components/back-in-block/static-analysis.tsx
+++ b/website/components/back-in-block/static-analysis.tsx
@@ -852,4 +852,4 @@ export const descriptions = [
export const StaticAnalysisExample = () => {
return ;
-};
\ No newline at end of file
+};
diff --git a/website/components/back-in-block/vdom.tsx b/website/components/back-in-block/vdom.tsx
index 767cfd33d5..ab60d75910 100644
--- a/website/components/back-in-block/vdom.tsx
+++ b/website/components/back-in-block/vdom.tsx
@@ -1568,4 +1568,4 @@ const descriptions = [
export const VDomExample = () => {
return ;
-};
\ No newline at end of file
+};
diff --git a/website/components/home/about.tsx b/website/components/home/about.tsx
index ef60ae934a..be51cc0f8c 100644
--- a/website/components/home/about.tsx
+++ b/website/components/home/about.tsx
@@ -24,8 +24,8 @@ export function About() {
React at the speed of raw JS
- Million.js automatically optimizes React, making it run way faster. It's one
- of the top performers in the{' '}
+ Million.js automatically optimizes React, making it run way
+ faster. It's one of the top performers in the{' '}
+
+
+ >
+ );
+}
diff --git a/website/components/icons/github-icon.tsx b/website/components/icons/github-icon.tsx
new file mode 100644
index 0000000000..a181239502
--- /dev/null
+++ b/website/components/icons/github-icon.tsx
@@ -0,0 +1,22 @@
+export function GitHubIcon() {
+ return (
+ <>
+
+
+ >
+ );
+}
diff --git a/website/components/icons/twitter-x-icon.tsx b/website/components/icons/twitter-x-icon.tsx
new file mode 100644
index 0000000000..31cda4d544
--- /dev/null
+++ b/website/components/icons/twitter-x-icon.tsx
@@ -0,0 +1,49 @@
+export function TwitterXIcon() {
+ return (
+ <>
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/website/components/million-library/block-878fb9ae.d.ts b/website/components/million-library/block-878fb9ae.d.ts
index 921bfce11c..d8b9e63f4b 100644
--- a/website/components/million-library/block-878fb9ae.d.ts
+++ b/website/components/million-library/block-878fb9ae.d.ts
@@ -1,21 +1,57 @@
-import { P as Props, a as VElement, V as VNode, A as AbstractBlock, E as Edit } from './types-35702ad2.js';
+import {
+ P as Props,
+ a as VElement,
+ V as VNode,
+ A as AbstractBlock,
+ E as Edit,
+} from './types-35702ad2.js';
-declare const block: (fn: (props?: Props) => VElement, unwrap?: ((vnode: any) => VNode) | undefined, shouldUpdate?: ((oldProps: Props, newProps: Props) => boolean) | undefined) => (props?: Props | null, key?: string, shouldUpdateCurrentBlock?: ((oldProps: Props, newProps: Props) => boolean) | undefined) => Block;
-declare const mount: (block: AbstractBlock, parent?: HTMLElement) => HTMLElement;
-declare const patch: (oldBlock: AbstractBlock, newBlock: AbstractBlock) => HTMLElement;
+declare const block: (
+ fn: (props?: Props) => VElement,
+ unwrap?: ((vnode: any) => VNode) | undefined,
+ shouldUpdate?: ((oldProps: Props, newProps: Props) => boolean) | undefined,
+) => (
+ props?: Props | null,
+ key?: string,
+ shouldUpdateCurrentBlock?:
+ | ((oldProps: Props, newProps: Props) => boolean)
+ | undefined,
+) => Block;
+declare const mount: (
+ block: AbstractBlock,
+ parent?: HTMLElement,
+) => HTMLElement;
+declare const patch: (
+ oldBlock: AbstractBlock,
+ newBlock: AbstractBlock,
+) => HTMLElement;
declare class Block extends AbstractBlock {
- r: HTMLElement;
- e: Edit[];
- constructor(root: HTMLElement, edits: Edit[], props?: Props | null, key?: string, shouldUpdate?: (oldProps: Props, newProps: Props) => boolean, getElements?: (root: HTMLElement) => HTMLElement[]);
- m(parent?: HTMLElement, refNode?: Node | null): HTMLElement;
- p(newBlock: AbstractBlock): HTMLElement;
- v(block?: AbstractBlock | null, refNode?: Node | null): void;
- x(): void;
- u(_oldProps: Props, _newProps: Props): boolean;
- s(): string;
- t(): HTMLElement | null | undefined;
+ r: HTMLElement;
+ e: Edit[];
+ constructor(
+ root: HTMLElement,
+ edits: Edit[],
+ props?: Props | null,
+ key?: string,
+ shouldUpdate?: (oldProps: Props, newProps: Props) => boolean,
+ getElements?: (root: HTMLElement) => HTMLElement[],
+ );
+ m(parent?: HTMLElement, refNode?: Node | null): HTMLElement;
+ p(newBlock: AbstractBlock): HTMLElement;
+ v(block?: AbstractBlock | null, refNode?: Node | null): void;
+ x(): void;
+ u(_oldProps: Props, _newProps: Props): boolean;
+ s(): string;
+ t(): HTMLElement | null | undefined;
}
declare const stringToDOM: (content: string) => HTMLElement;
declare const withKey: (value: any, key: string) => any;
-export { Block as B, block as b, mount as m, patch as p, stringToDOM as s, withKey as w };
+export {
+ Block as B,
+ block as b,
+ mount as m,
+ patch as p,
+ stringToDOM as s,
+ withKey as w,
+};
diff --git a/website/components/million-library/compiler.d.ts b/website/components/million-library/compiler.d.ts
index 1c668c24e7..a8ae9d02d8 100644
--- a/website/components/million-library/compiler.d.ts
+++ b/website/components/million-library/compiler.d.ts
@@ -3,22 +3,32 @@ import * as _babel_core from '@babel/core';
import { NodePath } from '@babel/core';
import * as t from '@babel/types';
-declare const _default: (api: object, options: Record | null | undefined, dirname: string) => {
- name: string;
- visitor: {
- CallExpression(this: _babel_core.PluginPass, path: NodePath): void;
- };
+declare const _default: (
+ api: object,
+ options: Record | null | undefined,
+ dirname: string,
+) => {
+ name: string;
+ visitor: {
+ CallExpression(
+ this: _babel_core.PluginPass,
+ path: NodePath,
+ ): void;
+ };
};
interface UserOptions {
- ignoreFiles?: string[];
- memo?: boolean;
- mode: 'react' | 'next' | 'react-server' | 'optimize';
+ ignoreFiles?: string[];
+ memo?: boolean;
+ mode: 'react' | 'next' | 'react-server' | 'optimize';
}
-declare const unplugin: _unplugin.UnpluginInstance;
+declare const unplugin: _unplugin.UnpluginInstance<
+ UserOptions | undefined,
+ boolean
+>;
declare const next: (nextConfig?: Record) => {
- webpack(config: Record, options: Record): any;
+ webpack(config: Record, options: Record): any;
};
export { _default as babelPlugin, unplugin as default, next, unplugin };
diff --git a/website/components/million-library/jsx-runtime.d.ts b/website/components/million-library/jsx-runtime.d.ts
index 8b255e5005..58e987cf20 100644
--- a/website/components/million-library/jsx-runtime.d.ts
+++ b/website/components/million-library/jsx-runtime.d.ts
@@ -1,5 +1,9 @@
import { P as Props, V as VNode } from './types-35702ad2.js';
-declare const h: (type: string, props?: Props | null, ...children: VNode[]) => VNode;
+declare const h: (
+ type: string,
+ props?: Props | null,
+ ...children: VNode[]
+) => VNode;
export { h as createElement, h, h as jsx, h as jsxs };
diff --git a/website/components/million-library/million.d.ts b/website/components/million-library/million.d.ts
index 374bf93a41..76373d9ae3 100644
--- a/website/components/million-library/million.d.ts
+++ b/website/components/million-library/million.d.ts
@@ -1,21 +1,37 @@
-export { B as Block, b as block, m as mount, p as patch, s as stringToDOM, w as withKey } from './block-878fb9ae.js';
+export {
+ B as Block,
+ b as block,
+ m as mount,
+ p as patch,
+ s as stringToDOM,
+ w as withKey,
+} from './block-878fb9ae.js';
import { A as AbstractBlock, V as VNode, E as Edit } from './types-35702ad2.js';
-export { A as AbstractBlock, P as Props, a as VElement, V as VNode } from './types-35702ad2.js';
+export {
+ A as AbstractBlock,
+ P as Props,
+ a as VElement,
+ V as VNode,
+} from './types-35702ad2.js';
declare const mapArray: (children: AbstractBlock[]) => ArrayBlock;
declare class ArrayBlock extends AbstractBlock {
- b: AbstractBlock[];
- constructor(children: AbstractBlock[]);
- v(): void;
- p(fragment: ArrayBlock): HTMLElement;
- m(parent: HTMLElement, refNode?: Node | null): HTMLElement;
- x(): void;
- u(): boolean;
- s(): string;
- t(): HTMLElement | null | undefined;
+ b: AbstractBlock[];
+ constructor(children: AbstractBlock[]);
+ v(): void;
+ p(fragment: ArrayBlock): HTMLElement;
+ m(parent: HTMLElement, refNode?: Node | null): HTMLElement;
+ x(): void;
+ u(): boolean;
+ s(): string;
+ t(): HTMLElement | null | undefined;
}
-declare const renderToTemplate: (vnode: VNode, edits?: Edit[], path?: number[]) => string;
+declare const renderToTemplate: (
+ vnode: VNode,
+ edits?: Edit[],
+ path?: number[],
+) => string;
declare const firstChild$: () => any;
declare const nextSibling$: () => any;
diff --git a/website/components/million-library/react-server.d.ts b/website/components/million-library/react-server.d.ts
index 6f6fe8f6b0..8f89a8af5d 100644
--- a/website/components/million-library/react-server.d.ts
+++ b/website/components/million-library/react-server.d.ts
@@ -1,13 +1,21 @@
import * as react from 'react';
import { FunctionComponent, ComponentProps } from 'react';
-declare const block: (Component: FunctionComponent) => (props: ComponentProps) => react.DOMElement, Element> | react.CElement>;
+declare const block: (
+ Component: FunctionComponent,
+) => (
+ props: ComponentProps,
+) =>
+ | react.DOMElement, Element>
+ | react.CElement>;
declare function For(props: {
- each: any[];
- children: (item: any, index: number) => any;
-}): react.FunctionComponentElement<{
- each: any[];
- children: (item: any, index: number) => any;
-}> | react.DOMElement, Element>;
+ each: any[];
+ children: (item: any, index: number) => any;
+}):
+ | react.FunctionComponentElement<{
+ each: any[];
+ children: (item: any, index: number) => any;
+ }>
+ | react.DOMElement, Element>;
export { For, block };
diff --git a/website/components/million-library/react.d.ts b/website/components/million-library/react.d.ts
index 98a0f463a5..7e5e2e6423 100644
--- a/website/components/million-library/react.d.ts
+++ b/website/components/million-library/react.d.ts
@@ -4,20 +4,34 @@ import { B as Block } from './block-878fb9ae.js';
import { P as Props, V as VNode } from './types-35702ad2.js';
interface Options {
- shouldUpdate?: (oldProps: Props, newProps: Props) => boolean;
+ shouldUpdate?: (oldProps: Props, newProps: Props) => boolean;
}
-declare const REGISTRY: Map<(props: Props) => ReactNode, (props?: Props | null | undefined, key?: string | undefined, shouldUpdateCurrentBlock?: ((oldProps: Props, newProps: Props) => boolean) | undefined) => Block>;
-declare const block: (fn: (props: Props) => ReactNode, options?: Options) => (props: Props) => react.FunctionComponentElement<{
- children?: ReactNode;
+declare const REGISTRY: Map<
+ (props: Props) => ReactNode,
+ (
+ props?: Props | null | undefined,
+ key?: string | undefined,
+ shouldUpdateCurrentBlock?:
+ | ((oldProps: Props, newProps: Props) => boolean)
+ | undefined,
+ ) => Block
+>;
+declare const block: (
+ fn: (props: Props) => ReactNode,
+ options?: Options,
+) => (props: Props) => react.FunctionComponentElement<{
+ children?: ReactNode;
}>;
interface MillionArrayProps {
- each: any[];
- children: (value: any, i: number) => ReactNode;
+ each: any[];
+ children: (value: any, i: number) => ReactNode;
}
declare const For: react.NamedExoticComponent;
-declare const renderReactScope: (jsx: ReactNode) => (el: HTMLElement | null) => HTMLElement;
+declare const renderReactScope: (
+ jsx: ReactNode,
+) => (el: HTMLElement | null) => HTMLElement;
declare const unwrap: (vnode?: ReactNode) => VNode;
export { For, REGISTRY, block, renderReactScope, unwrap };
diff --git a/website/components/million-library/types-35702ad2.d.ts b/website/components/million-library/types-35702ad2.d.ts
index 8023e22bd3..86d48a5a39 100644
--- a/website/components/million-library/types-35702ad2.d.ts
+++ b/website/components/million-library/types-35702ad2.d.ts
@@ -1,123 +1,129 @@
declare const enum Flags {
- Child = 1,
- Attribute = 2,
- Event = 4,
- StyleAttribute = 8,
- SvgAttribute = 16,
- Block = 32
+ Child = 1,
+ Attribute = 2,
+ Event = 4,
+ StyleAttribute = 8,
+ SvgAttribute = 16,
+ Block = 32,
}
type VNode = VElement | string | number | bigint | boolean | undefined | null;
type Props = Record;
interface VElement {
- type: string;
- props: Props & {
- children?: (VNode | Hole)[];
- };
+ type: string;
+ props: Props & {
+ children?: (VNode | Hole)[];
+ };
}
interface Hole {
- $: string;
+ $: string;
}
declare abstract class AbstractBlock {
- r?: HTMLElement;
- e?: Edit[];
- l?: HTMLElement | null;
- g?: (root: HTMLElement) => HTMLElement[];
- _t?: HTMLElement | null;
- d?: Props | null;
- k?: string;
- c?: HTMLElement[];
- abstract p(block: AbstractBlock): HTMLElement;
- abstract m(parent?: HTMLElement, refNode?: Node | null): HTMLElement;
- abstract v(block: AbstractBlock | null, refNode: Node | null): void;
- abstract x(): void;
- abstract s(): string;
- abstract u(oldProps: Props, newProps: Props): boolean;
- abstract t(): HTMLElement | null | undefined;
+ r?: HTMLElement;
+ e?: Edit[];
+ l?: HTMLElement | null;
+ g?: (root: HTMLElement) => HTMLElement[];
+ _t?: HTMLElement | null;
+ d?: Props | null;
+ k?: string;
+ c?: HTMLElement[];
+ abstract p(block: AbstractBlock): HTMLElement;
+ abstract m(parent?: HTMLElement, refNode?: Node | null): HTMLElement;
+ abstract v(block: AbstractBlock | null, refNode: Node | null): void;
+ abstract x(): void;
+ abstract s(): string;
+ abstract u(oldProps: Props, newProps: Props): boolean;
+ abstract t(): HTMLElement | null | undefined;
}
interface EditAttribute {
- t: Flags.Attribute;
- n: string;
- v: null;
- h: string;
- i: null;
- l: null;
- p: null;
- b: null;
+ t: Flags.Attribute;
+ n: string;
+ v: null;
+ h: string;
+ i: null;
+ l: null;
+ p: null;
+ b: null;
}
interface EditStyleAttribute {
- t: Flags.StyleAttribute;
- n: string;
- v: null;
- h: string;
- i: null;
- l: null;
- p: null;
- b: null;
+ t: Flags.StyleAttribute;
+ n: string;
+ v: null;
+ h: string;
+ i: null;
+ l: null;
+ p: null;
+ b: null;
}
interface EditSvgAttribute {
- t: Flags.SvgAttribute;
- n: string;
- v: null;
- h: string;
- i: null;
- l: null;
- p: null;
- b: null;
+ t: Flags.SvgAttribute;
+ n: string;
+ v: null;
+ h: string;
+ i: null;
+ l: null;
+ p: null;
+ b: null;
}
interface EditChild {
- t: Flags.Child;
- n: null;
- v: null;
- h: string;
- i: number;
- l: null;
- p: null;
- b: null;
+ t: Flags.Child;
+ n: null;
+ v: null;
+ h: string;
+ i: number;
+ l: null;
+ p: null;
+ b: null;
}
interface EditEvent {
- t: Flags.Event;
- n: string;
- v: null;
- h: string;
- i: null;
- l: null;
- p: ((listener: EventListener) => void) | null;
- b: null;
+ t: Flags.Event;
+ n: string;
+ v: null;
+ h: string;
+ i: null;
+ l: null;
+ p: ((listener: EventListener) => void) | null;
+ b: null;
}
interface InitEvent {
- t: Flags.Event;
- n: string;
- v: null;
- h: null;
- i: null;
- l: EventListener;
- p: null;
- b: null;
+ t: Flags.Event;
+ n: string;
+ v: null;
+ h: null;
+ i: null;
+ l: EventListener;
+ p: null;
+ b: null;
}
interface InitChild {
- t: Flags.Child;
- n: null;
- v: string;
- h: null;
- i: number;
- l: null;
- p: null;
- b: null;
+ t: Flags.Child;
+ n: null;
+ v: string;
+ h: null;
+ i: number;
+ l: null;
+ p: null;
+ b: null;
}
interface InitBlock {
- t: Flags.Block;
- n: null;
- v: null;
- h: null;
- i: number;
- l: null;
- p: null;
- b: AbstractBlock;
+ t: Flags.Block;
+ n: null;
+ v: null;
+ h: null;
+ i: number;
+ l: null;
+ p: null;
+ b: AbstractBlock;
}
interface Edit {
- p: number[] | null;
- e: (EditAttribute | EditStyleAttribute | EditSvgAttribute | EditChild | EditEvent)[];
- i: (InitChild | InitEvent | InitBlock)[] | null;
+ p: number[] | null;
+ e: (
+ | EditAttribute
+ | EditStyleAttribute
+ | EditSvgAttribute
+ | EditChild
+ | EditEvent
+ )[];
+ i: (InitChild | InitEvent | InitBlock)[] | null;
}
export { AbstractBlock as A, Edit as E, Props as P, VNode as V, VElement as a };
diff --git a/website/theme.config.tsx b/website/theme.config.tsx
index b001b8626d..a203b3c624 100644
--- a/website/theme.config.tsx
+++ b/website/theme.config.tsx
@@ -2,6 +2,9 @@ import React from 'react';
import { useRouter } from 'next/router';
import { type DocsThemeConfig, useConfig } from 'nextra-theme-docs';
import { ExtraContent } from './components/extra-content';
+import { GitHubIcon } from '@components/icons/github-icon';
+import { DiscordIcon } from '@components/icons/discord-icon';
+import { TwitterXIcon } from '@components/icons/twitter-x-icon';
const config: DocsThemeConfig = {
logo: () => {
@@ -99,9 +102,11 @@ const config: DocsThemeConfig = {
},
project: {
link: '/~https://github.com/aidenybai/million',
+ icon: ,
},
chat: {
link: 'https://discord.gg/X9yFbcV2rF',
+ icon: ,
},
docsRepositoryBase: '/~https://github.com/aidenybai/million/tree/main/website/',
footer: {
@@ -139,41 +144,7 @@ const config: DocsThemeConfig = {
),
},
navbar: {
- extraContent: (
- <>
-
-
-
-
-
-
- >
- ),
+ extraContent: ,
},
head: () => {
const { asPath, pathname } = useRouter();