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 packages/nanoviews/.size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"name": "Average usage (Gzip)",
"gzip": true,
"path": "dist/index.js",
"import": "{ fragment, div, form, input, button, label, classList$, if_, for_, value$, $$children, effect }",
"import": "{ fragment, div, form, input, button, label, classList$, if_, for_, value$, children$, effect }",
"limit": "3.8 kB"
},
{
"name": "Average usage (Brotli)",
"path": "dist/index.js",
"import": "{ fragment, div, form, input, button, label, classList$, if_, for_, value$, $$children, effect }",
"import": "{ fragment, div, form, input, button, label, classList$, if_, for_, value$, children$, effect }",
"limit": "3.55 kB"
}
]
8 changes: 4 additions & 4 deletions packages/nanoviews/src/component/children.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@nanoviews/storybook'
import { createElement } from '../elements/index.js'
import {
$$slot,
slot$,
getSlots
} from './children.js'

Expand All @@ -17,7 +17,7 @@ export default meta

type Story = StoryObj<typeof meta>

const TestSlot = (text: string) => $$slot(TestSlot, text)
const TestSlot = (text: string) => slot$(TestSlot, text)

export const NoSlot: Story = {
render: nanoStory(
Expand All @@ -39,8 +39,8 @@ export const Slot: Story = {
)
}

const PreSlot = (text: string) => $$slot(PreSlot, text)
const PostSlot = (text: string) => $$slot(PostSlot, text)
const PreSlot = (text: string) => slot$(PreSlot, text)
const PostSlot = (text: string) => slot$(PostSlot, text)

export const Slots: Story = {
render: nanoStory(
Expand Down
6 changes: 3 additions & 3 deletions packages/nanoviews/src/component/children.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { lazyChild } from '../internals/index.js'
* @param render - Function to render block with given children
* @returns Function that accepts children
*/
export function $$children<
export function children$<
T extends Child,
C extends unknown[] = Children
>(render: Renderer<T, C>) {
Expand All @@ -41,7 +41,7 @@ export function isSlot(value: unknown): value is Slot<unknown, AnyFn> {
* @param content - Slot content
* @returns Slot
*/
export function $$slot<
export function slot$<
C,
// oxlint-disable-next-line typescript/no-explicit-any
F extends (...args: any[]) => Slot<C, F>
Expand Down Expand Up @@ -98,7 +98,7 @@ export function getSlots<
* @param render - Function to render block with given slots and children
* @returns Function that accepts children
*/
export function $$slots<
export function slots$<
T extends Child,
D extends AnySlotDef[]
>(
Expand Down