Skip to content

Commit

Permalink
Merge branch 'main' of github.com:solidjs/solid
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Jun 27, 2024
2 parents 6693b56 + cba4eee commit b232a41
Show file tree
Hide file tree
Showing 14 changed files with 266 additions and 267 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
pnpm run coverage
- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
base-path: packages/solid
path-to-lcov: "./packages/solid/coverage/lcov.info"
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Note: If you would like your project listed here please submit a PR or contact a

There are a lot of opportunities to get involved. We organize Solid community efforts via Discord and typically onboard dedicated contributors into focused teams:

- Core Docs (headed by [@LadyBluenotes](https://github.com/ladybluenotes))
- Solid Start Docs (headed by [@michaelessiet](https://github.com/michaelessiet))
- Docs (headed by [@LadyBluenotes](https://github.com/ladybluenotes))
- Infrastructure (headed by [@davedbase](https://github.com/davedbase))
- Advocacy (headed by [@hindsight](https://github.com/eslachance))
- Growth (headed by [@davedbase](https://github.com/davedbase))
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![Discord](https://img.shields.io/discord/722131463138705510?style=for-the-badge)](https://discord.com/invite/solidjs)
[![Subreddit subscribers](https://img.shields.io/reddit/subreddit-subscribers/solidjs?style=for-the-badge)](https://www.reddit.com/r/solidjs/)

**[Website](https://www.solidjs.com/)[API Docs](https://www.solidjs.com/docs/latest/api)[Features Tutorial](https://www.solidjs.com/tutorial/introduction_basics)[Playground](https://playground.solidjs.com/?version=1.3.13#NobwRAdghgtgpmAXGGUCWEwBowBcCeADgsrgM4Ae2YZA9gK4BOAxiWGjIbY7gAQi9GcCABM4jXgF9eAM0a0YvADo1aAGzQiAtACsyAegDucAEYqA3EogcuPfr2ZCouOAGU0Ac2hqps+YpU6DW09CysrGXoIZlw0WgheAGEGCBdGAAoASn4rXgd4sj5gZhTcLF4yOFxkqNwAXV4AXgcnF3cvKDV0gAZMywT8iELeDEc4eFSm3iymgD4KqprU9JLamYBqXgBGPvCBoVwmBPTcvN4AHhN6XFx43gJiRpUrm-iVXnjEjWYAa0aQUZCCa4SSzU5nfirZaZSTgi76F63CBgga7CCwiBWISicTpGaNebnJZpXj6WblES0Zj0YEAOg8VQAompxsJcAAhfAASREJzAUEIhBUmTRYEkdSAA)[Discord](https://discord.com/invite/solidjs)**
**[Website](https://www.solidjs.com/)[API Docs](https://docs.solidjs.com/)[Features Tutorial](https://www.solidjs.com/tutorial/introduction_basics)[Playground](https://playground.solidjs.com/?version=1.3.13#NobwRAdghgtgpmAXGGUCWEwBowBcCeADgsrgM4Ae2YZA9gK4BOAxiWGjIbY7gAQi9GcCABM4jXgF9eAM0a0YvADo1aAGzQiAtACsyAegDucAEYqA3EogcuPfr2ZCouOAGU0Ac2hqps+YpU6DW09CysrGXoIZlw0WgheAGEGCBdGAAoASn4rXgd4sj5gZhTcLF4yOFxkqNwAXV4AXgcnF3cvKDV0gAZMywT8iELeDEc4eFSm3iymgD4KqprU9JLamYBqXgBGPvCBoVwmBPTcvN4AHhN6XFx43gJiRpUrm-iVXnjEjWYAa0aQUZCCa4SSzU5nfirZaZSTgi76F63CBgga7CCwiBWISicTpGaNebnJZpXj6WblES0Zj0YEAOg8VQAompxsJcAAhfAASREJzAUEIhBUmTRYEkdSAA)[Discord](https://discord.com/invite/solidjs)**

Solid is a declarative JavaScript library for creating user interfaces. Instead of using a Virtual DOM, it compiles its templates to real DOM nodes and updates them with fine-grained reactions. Declare your state and use it throughout your app, and when a piece of state changes, only the code that depends on it will rerun.

Expand Down Expand Up @@ -184,7 +184,7 @@ Do more with less: use simple, composable primitives without hidden rules and go

### Productive

Solid is built on established tools like JSX and TypeScript and integrates with the Vite ecosystem. Solid's bare-metal, minimal abstractions give you direct access to the DOM, making it easy to use your favorite native JavaScript libraries like D3. And the Solid ecosystem is growing fast, with [custom primitives](https://github.com/solidjs-community/solid-primitives), [component libraries](https://hope-ui.com/), and build-time utilities that let you [write Solid code in new ways](https://github.com/LXSMNSYC/solid-labels).
Solid is built on established tools like JSX and TypeScript and integrates with the Vite ecosystem. Solid's bare-metal, minimal abstractions give you direct access to the DOM, making it easy to use your favorite native JavaScript libraries like D3. And the Solid ecosystem is growing fast, with [custom primitives](https://github.com/solidjs-community/solid-primitives), [component libraries](https://kobalte.dev), and build-time utilities that let you [write Solid code in new ways](https://github.com/LXSMNSYC/solid-labels).

## More

Expand Down
446 changes: 223 additions & 223 deletions packages/solid/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/solid/src/reactive/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SOFTWARE.
*
* similar to `Array.prototype.map`, but gets the index as accessor, transforms only values that changed and returns an accessor and reactively tracks changes to the list.
*
* @description https://www.solidjs.com/docs/latest/api#maparray
* @description https://docs.solidjs.com/reference/reactive-utilities/map-array
*/
export function mapArray<T, U>(
list: Accessor<readonly T[] | undefined | null | false>,
Expand Down Expand Up @@ -180,7 +180,7 @@ export function mapArray<T, U>(
*
* similar to `Array.prototype.map`, but gets the value as an accessor, transforms only changed items of the original arrays anew and returns an accessor.
*
* @description https://www.solidjs.com/docs/latest/api#indexarray
* @description https://docs.solidjs.com/reference/reactive-utilities/index-array
*/
export function indexArray<T, U>(
list: Accessor<readonly T[] | undefined | null | false>,
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/reactive/observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type ObservableObserver<T> =
* const obsv$ = from(observable(s));
* obsv$.subscribe((v) => console.log(v));
* ```
* description https://www.solidjs.com/docs/latest/api#observable
* description https://docs.solidjs.com/reference/reactive-utilities/observable
*/
export function observable<T>(input: Accessor<T>): Observable<T> {
return {
Expand Down
44 changes: 22 additions & 22 deletions packages/solid/src/reactive/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export type RootFunction<T> = (dispose: () => void) => T;
* @param detachedOwner optional reactive context to bind the root to
* @returns the output of `fn`.
*
* @description https://www.solidjs.com/docs/latest/api#createroot
* @description https://docs.solidjs.com/reference/reactive-utilities/create-root
*/
export function createRoot<T>(fn: RootFunction<T>, detachedOwner?: typeof Owner): T {
const listener = Listener,
Expand Down Expand Up @@ -213,7 +213,7 @@ export interface SignalOptions<T> extends MemoOptions<T> {
* setCount(count => count + 1);
* ```
*
* @description https://www.solidjs.com/docs/latest/api#createsignal
* @description https://docs.solidjs.com/reference/basic-reactivity/create-signal
*/
export function createSignal<T>(): Signal<T | undefined>;
export function createSignal<T>(value: T, options?: SignalOptions<T>): Signal<T>;
Expand Down Expand Up @@ -274,7 +274,7 @@ export type EffectFunction<Prev, Next extends Prev = Prev> = (v: Prev) => Next;
* @param value an optional initial value for the computation; if set, fn will never receive undefined as first argument
* @param options allows to set a name in dev mode for debugging purposes
*
* @description https://www.solidjs.com/docs/latest/api#createcomputed
* @description https://docs.solidjs.com/reference/secondary-primitives/create-computed
*/
export function createComputed<Next>(fn: EffectFunction<undefined | NoInfer<Next>, Next>): void;
export function createComputed<Next, Init = Next>(
Expand Down Expand Up @@ -305,7 +305,7 @@ export function createComputed<Next, Init>(
* @param value an optional initial value for the computation; if set, fn will never receive undefined as first argument
* @param options allows to set a name in dev mode for debugging purposes
*
* @description https://www.solidjs.com/docs/latest/api#createrendereffect
* @description https://docs.solidjs.com/reference/secondary-primitives/create-render-effect
*/
export function createRenderEffect<Next>(fn: EffectFunction<undefined | NoInfer<Next>, Next>): void;
export function createRenderEffect<Next, Init = Next>(
Expand Down Expand Up @@ -336,7 +336,7 @@ export function createRenderEffect<Next, Init>(
* @param value an optional initial value for the computation; if set, fn will never receive undefined as first argument
* @param options allows to set a name in dev mode for debugging purposes
*
* @description https://www.solidjs.com/docs/latest/api#createeffect
* @description https://docs.solidjs.com/reference/basic-reactivity/create-effect
*/
export function createEffect<Next>(fn: EffectFunction<undefined | NoInfer<Next>, Next>): void;
export function createEffect<Next, Init = Next>(
Expand Down Expand Up @@ -368,7 +368,7 @@ export function createEffect<Next, Init>(
* @param invalidated a function that is called when tracked function is invalidated.
* @param options allows to set a name in dev mode for debugging purposes
*
* @description https://www.solidjs.com/docs/latest/api#createreaction
* @description https://docs.solidjs.com/reference/secondary-primitives/create-reaction
*/
export function createReaction(onInvalidate: () => void, options?: EffectOptions) {
let fn: (() => void) | undefined;
Expand Down Expand Up @@ -413,7 +413,7 @@ export interface MemoOptions<T> extends EffectOptions {
* @param value an optional initial value for the computation; if set, fn will never receive undefined as first argument
* @param options allows to set a name in dev mode for debugging purposes and use a custom comparison function in equals
*
* @description https://www.solidjs.com/docs/latest/api#creatememo
* @description https://docs.solidjs.com/reference/basic-reactivity/create-memo
*/
// The extra Prev generic parameter separates inference of the effect input
// parameter type from inference of the effect return type, so that the effect
Expand Down Expand Up @@ -562,7 +562,7 @@ function isPromise(v: any): v is Promise<any> {
* * `mutate` allows to manually overwrite the resource without calling the fetcher
* * `refetch` will re-run the fetcher without changing the source, and if called with a value, that value will be passed to the fetcher via the `refetching` property on the fetcher's second parameter
*
* @description https://www.solidjs.com/docs/latest/api#createresource
* @description https://docs.solidjs.com/reference/basic-reactivity/create-resource
*/
export function createResource<T, R = unknown>(
fetcher: ResourceFetcher<true, T, R>,
Expand Down Expand Up @@ -752,7 +752,7 @@ export interface DeferredOptions<T> {
* @param fn a function that receives its previous or the initial value, if set, and returns a new value used to react on a computation
* @param options allows to set the timeout in milliseconds, use a custom comparison function and set a name in dev mode for debugging purposes
*
* @description https://www.solidjs.com/docs/latest/api#createdeferred
* @description https://docs.solidjs.com/reference/secondary-primitives/create-deferred
*/
export function createDeferred<T>(source: Accessor<T>, options?: DeferredOptions<T>) {
let t: Task,
Expand Down Expand Up @@ -804,7 +804,7 @@ export type EqualityCheckerFunction<T, U> = (a: U, b: T) => boolean;
*
* This makes the operation O(2) instead of O(n).
*
* @description https://www.solidjs.com/docs/latest/api#createselector
* @description https://docs.solidjs.com/reference/secondary-primitives/create-selector
*/
export function createSelector<T, U = T>(
source: Accessor<T>,
Expand Down Expand Up @@ -854,7 +854,7 @@ export function createSelector<T, U = T>(
* @param fn wraps the reactive updates that should be batched
* @returns the return value from `fn`
*
* @description https://www.solidjs.com/docs/latest/api#batch
* @description https://docs.solidjs.com/reference/reactive-utilities/batch
*/
export function batch<T>(fn: Accessor<T>): T {
return runUpdates(fn, false) as T;
Expand All @@ -865,7 +865,7 @@ export function batch<T>(fn: Accessor<T>): T {
* @param fn the scope that is out of the tracking context
* @returns the return value of `fn`
*
* @description https://www.solidjs.com/docs/latest/api#untrack
* @description https://docs.solidjs.com/reference/reactive-utilities/untrack
*/
export function untrack<T>(fn: Accessor<T>): T {
if (!ExternalSourceConfig && Listener === null) return fn();
Expand Down Expand Up @@ -925,7 +925,7 @@ export interface OnOptions {
* });
* ```
*
* @description https://www.solidjs.com/docs/latest/api#on
* @description https://docs.solidjs.com/reference/jsx-attributes/on_
*/
export function on<S, Next extends Prev, Prev = Next>(
deps: AccessorArray<S> | Accessor<S>,
Expand Down Expand Up @@ -965,7 +965,7 @@ export function on<S, Next extends Prev, Prev = Next>(
* Runs an effect only after initial render on mount
* @param fn an effect that should run only once on mount
*
* @description https://www.solidjs.com/docs/latest/api#onmount
* @description https://docs.solidjs.com/reference/lifecycle/on-mount
*/
export function onMount(fn: () => void) {
createEffect(() => untrack(fn));
Expand All @@ -977,7 +977,7 @@ export function onMount(fn: () => void) {
*
* @returns the same {@link fn} function that was passed in
*
* @description https://www.solidjs.com/docs/latest/api#oncleanup
* @description https://docs.solidjs.com/reference/lifecycle/on-cleanup
*/
export function onCleanup<T extends () => any>(fn: T): T {
if (Owner === null)
Expand All @@ -995,7 +995,7 @@ export function onCleanup<T extends () => any>(fn: T): T {
*
* * If the error is thrown again inside the error handler, it will trigger the next available parent handler
*
* @description https://www.solidjs.com/docs/latest/api#catcherror
* @description https://docs.solidjs.com/reference/reactive-utilities/catch-error
*/
export function catchError<T>(fn: () => T, handler: (err: Error) => void) {
ERROR || (ERROR = Symbol("error"));
Expand Down Expand Up @@ -1044,7 +1044,7 @@ export function enableScheduling(scheduler = requestCallback) {
* export function startTransition(fn: () => void) => Promise<void>
* ```
*
* @description https://www.solidjs.com/docs/latest/api#usetransition
* @description https://docs.solidjs.com/reference/reactive-utilities/start-transition
*/
export function startTransition(fn: () => unknown): Promise<void> {
if (Transition && Transition.running) {
Expand Down Expand Up @@ -1090,7 +1090,7 @@ export type Transition = [Accessor<boolean>, (fn: () => void) => Promise<void>];
* ];
* @returns a tuple; first value is an accessor if the transition is pending and a callback to start the transition
*
* @description https://www.solidjs.com/docs/latest/api#usetransition
* @description https://docs.solidjs.com/reference/reactive-utilities/use-transition
*/
export function useTransition(): Transition {
return [transPending, startTransition];
Expand Down Expand Up @@ -1161,7 +1161,7 @@ export interface Context<T> {
* @param options allows to set a name in dev mode for debugging purposes
* @returns The context that contains the Provider Component and that can be used with `useContext`
*
* @description https://www.solidjs.com/docs/latest/api#createcontext
* @description https://docs.solidjs.com/reference/component-apis/create-context
*/
export function createContext<T>(
defaultValue?: undefined,
Expand All @@ -1182,7 +1182,7 @@ export function createContext<T>(
* @param context Context object made by `createContext`
* @returns the current or `defaultValue`, if present
*
* @description https://www.solidjs.com/docs/latest/api#usecontext
* @description https://docs.solidjs.com/reference/component-apis/use-context
*/
export function useContext<T>(context: Context<T>): T {
return Owner && Owner.context && Owner.context[context.id] !== undefined
Expand All @@ -1200,7 +1200,7 @@ export type ChildrenReturn = Accessor<ResolvedChildren> & { toArray: () => Resol
* @param fn an accessor for the children
* @returns a accessor of the same children, but resolved
*
* @description https://www.solidjs.com/docs/latest/api#children
* @description https://docs.solidjs.com/reference/component-apis/children
*/
export function children(fn: Accessor<JSX.Element>): ChildrenReturn {
const children = createMemo(fn);
Expand Down Expand Up @@ -1750,7 +1750,7 @@ type TODO = any;
*
* * If the error is thrown again inside the error handler, it will trigger the next available parent handler
*
* @description https://www.solidjs.com/docs/latest/api#onerror
* @description https://www.solidjs.com/docs/latest/api#onerror | https://docs.solidjs.com/reference/reactive-utilities/catch-error
*/
export function onError(fn: (err: Error) => void): void {
ERROR || (ERROR = Symbol("error"));
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/src/render/Suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const SuspenseListContext = createContext<SuspenseListContextType>();
/**
* **[experimental]** Controls the order in which suspended content is rendered
*
* @description https://www.solidjs.com/docs/latest/api#suspenselist-experimental
* @description https://docs.solidjs.com/reference/components/suspense-list
*/
export function SuspenseList(props: {
children: JSX.Element;
Expand Down Expand Up @@ -118,7 +118,7 @@ export function SuspenseList(props: {
* <AsyncComponent />
* </Suspense>
* ```
* @description https://www.solidjs.com/docs/latest/api#suspense
* @description https://docs.solidjs.com/reference/components/suspense
*/
export function Suspense(props: { fallback?: JSX.Element; children: JSX.Element }) {
let counter = 0,
Expand Down
12 changes: 6 additions & 6 deletions packages/solid/src/render/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const narrowedError = (name: string) =>
* ```
* If you have a list with fixed indices and changing values, consider using `<Index>` instead.
*
* @description https://www.solidjs.com/docs/latest/api#for
* @description https://docs.solidjs.com/reference/components/for
*/
export function For<T extends readonly any[], U extends JSX.Element>(props: {
each: T | undefined | null | false;
Expand Down Expand Up @@ -59,7 +59,7 @@ export function For<T extends readonly any[], U extends JSX.Element>(props: {
* ```
* If you have a list with changing indices, better use `<For>`.
*
* @description https://www.solidjs.com/docs/latest/api#index
* @description https://docs.solidjs.com/reference/components/index
*/
export function Index<T extends readonly any[], U extends JSX.Element>(props: {
each: T | undefined | null | false;
Expand All @@ -81,7 +81,7 @@ export function Index<T extends readonly any[], U extends JSX.Element>(props: {
type RequiredParameter<T> = T extends () => unknown ? never : T;
/**
* Conditionally render its children or an optional fallback component
* @description https://www.solidjs.com/docs/latest/api#show
* @description https://docs.solidjs.com/reference/components/show
*/
export function Show<
T,
Expand Down Expand Up @@ -155,7 +155,7 @@ type EvalConditions = readonly [number, unknown?, MatchProps<unknown>?];
* </Match>
* </Switch>
* ```
* @description https://www.solidjs.com/docs/latest/api#switchmatch
* @description https://docs.solidjs.com/reference/components/switch-and-match
*/
export function Switch(props: { fallback?: JSX.Element; children: JSX.Element }): JSX.Element {
let keyed = false;
Expand Down Expand Up @@ -214,7 +214,7 @@ export type MatchProps<T> = {
* <Content/>
* </Match>
* ```
* @description https://www.solidjs.com/docs/latest/api#switchmatch
* @description https://docs.solidjs.com/reference/components/switch-and-match
*/
export function Match<
T,
Expand Down Expand Up @@ -250,7 +250,7 @@ export function resetErrorBoundaries() {
* ```
* Errors thrown from the fallback can be caught by a parent ErrorBoundary
*
* @description https://www.solidjs.com/docs/latest/api#errorboundary
* @description https://docs.solidjs.com/reference/components/error-boundary
*/
export function ErrorBoundary(props: {
fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element);
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/server/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export function Index<T>(props: {
type RequiredParameter<T> = T extends () => unknown ? never : T;
/**
* Conditionally render its children or an optional fallback component
* @description https://www.solidjs.com/docs/latest/api#show
* @description https://docs.solidjs.com/reference/components/show
*/
export function Show<T>(props: {
when: T | undefined | null | false;
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This submodules contains the means for handling deeps nested reactivity. It prov

This also contains helper methods `produce` and `reconcile` which augment the behavior of the store setter method to allow for localized mutation and data diffing.

For full documentation, check out the [website](https://www.solidjs.com/docs/latest/api).
For full documentation, check out the [website](https://docs.solidjs.com).

## Example

Expand Down
2 changes: 1 addition & 1 deletion packages/solid/store/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ export interface SetStoreFunction<T> {
/**
* Creates a reactive store that can be read through a proxy object and written with a setter function
*
* @description https://www.solidjs.com/docs/latest/api#createstore
* @description https://docs.solidjs.com/reference/store-utilities/create-store
*/
export function createStore<T extends object = {}>(
...[store, options]: {} extends T
Expand Down
Loading

0 comments on commit b232a41

Please sign in to comment.