Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solidjs/solid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.9.3
Choose a base ref
...
head repository: solidjs/solid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.9.5
Choose a head ref
  • 20 commits
  • 32 files changed
  • 7 contributors

Commits on Nov 1, 2024

  1. Improve resolving arguments in createResource (#2353)

    * Improve resolving arguments in createResource
    
    Check typeof the second argument instead of using the `arguments` variable.
    This fixes usedase where some arguments were passed explicitely as `undefined` instead of being omitted.
    
    * Create twelve-comics-knock.md
    
    ---------
    
    Co-authored-by: Ryan Carniato <[email protected]>
    thetarnav and ryansolid authored Nov 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    32aa744 View commit details

Commits on Nov 14, 2024

  1. fix reconcile null guard

    ryansolid committed Nov 14, 2024
    Copy the full SHA
    199dd69 View commit details
  2. Merge branch 'main' of github.com:solidjs/solid

    ryansolid committed Nov 14, 2024
    Copy the full SHA
    4d824b0 View commit details

Commits on Jan 7, 2025

  1. fix escaping in resolution done outside of DOM Expressions

    ryansolid committed Jan 7, 2025
    Copy the full SHA
    b93956f View commit details
  2. formatting

    ryansolid committed Jan 7, 2025
    Copy the full SHA
    dca942a View commit details
  3. lazy image, tagged template detection, security fixes

    ryansolid committed Jan 7, 2025
    Copy the full SHA
    7f9cd3d View commit details
  4. v1.9.4

    ryansolid committed Jan 7, 2025
    Copy the full SHA
    9316baf View commit details

Commits on Jan 8, 2025

  1. Update typescript to 5.7 (#2382)

    * Update typescript to 5.7
    
    * Create many-crabs-reply.md
    
    ---------
    
    Co-authored-by: Ryan Carniato <[email protected]>
    thetarnav and ryansolid authored Jan 8, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fff8aed View commit details

Commits on Feb 21, 2025

  1. Bump vite from 5.4.8 to 5.4.14 (#2407)

    Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.8 to 5.4.14.
    - [Release notes](https://github.com/vitejs/vite/releases)
    - [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md)
    - [Commits](https://github.com/vitejs/vite/commits/v5.4.14/packages/vite)
    
    ---
    updated-dependencies:
    - dependency-name: vite
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 21, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7ec7f22 View commit details
  2. update lockfile

    ryansolid committed Feb 21, 2025
    Copy the full SHA
    88e2790 View commit details
  3. chore: update copyright year (#2397)

    maxktz authored Feb 21, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3579ec0 View commit details
  4. dev: Add internal flag to signal (#2393)

    * dev: Add `internal` flag to signal
    
    * Create eighty-parents-scream.md
    
    ---------
    
    Co-authored-by: Ryan Carniato <[email protected]>
    thetarnav and ryansolid authored Feb 21, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    89e016d View commit details
  5. dev: Add afterRegisterGraph hook replacing afterCreateSignal (#2396)

    * dev: Add afterRegisterGraph hook replacing afterCreateSignal
    Deprecate afterCreateSignal for now
    
    * Create wise-crabs-destroy.md
    
    ---------
    
    Co-authored-by: Ryan Carniato <[email protected]>
    thetarnav and ryansolid authored Feb 21, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f9ef621 View commit details
  6. Show double evaluation (#2411)

    * Added tests for Show counting condition evaluations
    
    The `<Show>` component evaluates its `when` condition more often than necessary, in particular it is immediately evaluated twice if the condition is true, children is specified as a function, and keyed is not specified.
    
    #2406
    
    * Fixes <Show> evaluating the condition twice
    
    Adds another memo directly on `when` in `<Show>`.
    
    #2406
    
    * Made <Match> conditions only evaluate when needed
    
    This removes a bug where the `when` condition of a `<Match>` was evaluated twice immediately after creation, when the condition was true, children was a function and keyed was not specified. It also removes any unnecessary conditions evaluations by creating a memo on every `when` in a `Switch`.
    
    For example, if a `<Switch>` has two `<Match>`es with `when={a()}` and `when={b()}` respectively, then:
    - `b()` is never called if `a()` is truthy (which was true also before this change),
    - `a()` is never called when `b()` changes (which is new).
    
    #2406
    
    * changeset
    TPReal authored Feb 21, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0eab77d View commit details
  7. Add createDynamic utility. (#2422)

    DaniGuardiola authored Feb 21, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e897701 View commit details
  8. add optional initalValue argument to from helper (#2429)

    * add optional initalValue to `from` helper
    
    * Create dull-bikes-reply.md
    
    ---------
    
    Co-authored-by: Ryan Carniato <[email protected]>
    chris-kruining and ryansolid authored Feb 21, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    86ae8a9 View commit details
  9. mirror createDynamic on SSR

    ryansolid committed Feb 21, 2025
    Copy the full SHA
    9431b88 View commit details
  10. format

    ryansolid committed Feb 21, 2025
    Copy the full SHA
    1f83ebc View commit details
  11. JSX type updates, preliminary MathML support, fix spread overescaping

    ryansolid committed Feb 21, 2025
    Copy the full SHA
    35266c1 View commit details
  12. v1.9.5

    ryansolid committed Feb 21, 2025
    Copy the full SHA
    29ab5bb View commit details
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016-2023 Ryan Carniato
Copyright (c) 2016-2025 Ryan Carniato

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -34,13 +34,13 @@
"@rollup/plugin-replace": "^5.0.2",
"@types/node": "^22.7.5",
"@vitest/coverage-v8": "^2.1.2",
"babel-plugin-jsx-dom-expressions": "^0.39.3",
"babel-plugin-jsx-dom-expressions": "^0.39.7",
"coveralls": "^3.1.1",
"csstype": "^3.1.0",
"dom-expressions": "0.39.4",
"hyper-dom-expressions": "0.39.4",
"dom-expressions": "0.39.7",
"hyper-dom-expressions": "0.39.7",
"jsdom": "^25.0.1",
"lit-dom-expressions": "0.39.4",
"lit-dom-expressions": "0.39.7",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
@@ -53,7 +53,7 @@
"symlink-dir": "^5.0.1",
"tsconfig-replace-paths": "^0.0.11",
"turbo": "^1.3.1",
"typescript": "~5.5.2",
"typescript": "~5.7.2",
"vite-plugin-solid": "^2.6.1",
"vitest": "^2.1.2"
},
6 changes: 6 additions & 0 deletions packages/babel-preset-solid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# babel-preset-solid

## 1.9.5

### Patch Changes

- 35266c1: JSX type updates, preliminary MathML support, fix spread overescaping

## 1.9.3

### Patch Changes
4 changes: 2 additions & 2 deletions packages/babel-preset-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-solid",
"version": "1.9.3",
"version": "1.9.5",
"description": "Babel preset to transform JSX for Solid.js",
"author": "Ryan Carniato <ryansolid@gmail.com>",
"homepage": "https://github.com/solidjs/solid/blob/main/packages/babel-preset-solid#readme",
@@ -14,7 +14,7 @@
"test": "node test.js"
},
"dependencies": {
"babel-plugin-jsx-dom-expressions": "^0.39.3"
"babel-plugin-jsx-dom-expressions": "^0.39.7"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
2 changes: 1 addition & 1 deletion packages/solid-element/package.json
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
"component-register": "^0.8.7"
},
"peerDependencies": {
"solid-js": "^1.9.3"
"solid-js": "^1.9.5"
},
"devDependencies": {
"solid-js": "workspace:*"
21 changes: 21 additions & 0 deletions packages/solid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# solid-js

## 1.9.5

### Patch Changes

- 86ae8a9: add optional initalValue argument to `from` helper
- 89e016d: dev: Add `internal` flag to signal
- 9431b88: Mirror createDynamic for SSR
- 35266c1: JSX type updates, preliminary MathML support, fix spread overescaping
- 0eab77d: Removed unnecessary evaluations of <Show> and <Match> conditions.
- fff8aed: Update typescript to 5.7
- f9ef621: dev: Add afterRegisterGraph hook replacing afterCreateSignal

## 1.9.4

### Patch Changes

- b93956f: fix escaping in resolution done outside of DOM Expressions
- 199dd69: fix reconcile null guard
- 7f9cd3d: lazy image, tagged template detection, security fixes
- 32aa744: Improve resolving arguments in createResource

## 1.9.3

### Patch Changes
2 changes: 1 addition & 1 deletion packages/solid/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "solid-js",
"description": "A declarative JavaScript library for building user interfaces.",
"version": "1.9.3",
"version": "1.9.5",
"author": "Ryan Carniato",
"license": "MIT",
"homepage": "https://solidjs.com",
8 changes: 3 additions & 5 deletions packages/solid/src/index.ts
Original file line number Diff line number Diff line change
@@ -72,17 +72,15 @@ type JSXElement = JSX.Element;
export type { JSXElement, JSX };

// dev
import { registerGraph, writeSignal, DevHooks } from "./reactive/signal.js";
export const DEV = "_SOLID_DEV_"
? ({ hooks: DevHooks, writeSignal, registerGraph } as const)
: undefined;
import { registerGraph, writeSignal, DevHooks, IS_DEV } from "./reactive/signal.js";
export const DEV = IS_DEV ? ({ hooks: DevHooks, writeSignal, registerGraph } as const) : undefined;

// handle multiple instance check
declare global {
var Solid$$: boolean;
}

if ("_SOLID_DEV_" && globalThis) {
if (IS_DEV && globalThis) {
if (!globalThis.Solid$$) globalThis.Solid$$ = true;
else
console.warn(
7 changes: 4 additions & 3 deletions packages/solid/src/reactive/array.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ import {
createSignal,
Accessor,
Setter,
$TRACK
$TRACK,
IS_DEV
} from "./signal.js";

const FALLBACK = Symbol("fallback");
@@ -166,7 +167,7 @@ export function mapArray<T, U>(
function mapper(disposer: () => void) {
disposers[j] = disposer;
if (indexes) {
const [s, set] = "_SOLID_DEV_" ? createSignal(j, { name: "index" }) : createSignal(j);
const [s, set] = IS_DEV ? createSignal(j, { name: "index" }) : createSignal(j);
indexes[j] = set;
return mapFn(newItems[j], s);
}
@@ -243,7 +244,7 @@ export function indexArray<T, U>(
});
function mapper(disposer: () => void) {
disposers[i] = disposer;
const [s, set] = "_SOLID_DEV_"
const [s, set] = IS_DEV
? createSignal(newItems[i], { name: "value" })
: createSignal(newItems[i]);
signals[i] = set;
13 changes: 9 additions & 4 deletions packages/solid/src/reactive/observable.ts
Original file line number Diff line number Diff line change
@@ -84,12 +84,17 @@ export function observable<T>(input: Accessor<T>): Observable<T> {
};
}

type Producer<T> =
| ((setter: Setter<T>) => () => void)
| { subscribe: (fn: (v: T) => void) => (() => void) | { unsubscribe: () => void } };

export function from<T>(producer: Producer<T>, initalValue: T): Accessor<T>;
export function from<T>(producer: Producer<T | undefined>): Accessor<T | undefined>;
export function from<T>(
producer:
| ((setter: Setter<T | undefined>) => () => void)
| { subscribe: (fn: (v: T) => void) => (() => void) | { unsubscribe: () => void } }
producer: Producer<T | undefined>,
initalValue: T | undefined = undefined
): Accessor<T | undefined> {
const [s, set] = createSignal<T | undefined>(undefined, { equals: false });
const [s, set] = createSignal<T | undefined>(initalValue, { equals: false });
if ("subscribe" in producer) {
const unsub = producer.subscribe(v => set(() => v));
onCleanup(() => ("unsubscribe" in unsub ? unsub.unsubscribe() : unsub()));
Loading