Skip to content

Commit

Permalink
Solid 1.9 (#2306)
Browse files Browse the repository at this point in the history
* update dom-expressions to include client-side API placeholders in web/dist/server.js

* update dom-expressions version to temporary one from git for testing

* update lock file

* Add exports to solid-js/store's server build to match the client build, marking the additional export as not supported on the server side

* update dom-expressions

* fix!: Remove browser field from package.json (#2255)

* fix!: Remove browser field from package.json of core packages so that worker export doesn't get mapped back to removeBrowserPackageJson

BREAKING CHANGE: Jest was previously mentioned as the reason that wasn't removed, but Jest now supports package.json modules. That said, some other tooling might still not support esm exports.

* Create rare-birds-train.md

---------

Co-authored-by: Ryan Carniato <ryansolid@gmail.com>

* better handling of exports client/server

* Improve signal setter type for code completion of string literal unions. (#2297)

* fix

* fix test

* Create shy-islands-talk.md

---------

Co-authored-by: Ryan Carniato <ryansolid@gmail.com>

* update TS to NodeNext

---------

Co-authored-by: Joe Pea <joe@trusktr.io>
Co-authored-by: Will Kelly <67284402+wkelly17@users.noreply.github.com>
Co-authored-by: 狐狸 <134658521+Huliiiiii@users.noreply.github.com>
  • Loading branch information
4 people committed Sep 24, 2024
1 parent 8103fe0 commit 81feefb
Show file tree
Hide file tree
Showing 21 changed files with 353 additions and 68 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-onions-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": minor
---

better handling of exports client/server
5 changes: 5 additions & 0 deletions .changeset/rare-birds-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": minor
---

fix!: Remove browser field from package.json
5 changes: 5 additions & 0 deletions .changeset/shy-islands-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": patch
---

Improve signal setter type for code completion of string literal unions.
16 changes: 16 additions & 0 deletions .changeset/tasty-knives-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"babel-preset-solid": minor
"solid-js": minor
"solid-element": minor
"test-integration": minor
---

update dom-expressions
* Improved Custom Element/Shadow DOM traversal - @olivercoad
* Better heuristic to determine when to importNode - @titoBouzout
* handleEvent syntax to allow custom event properties when not delegated - @titoBouzout
* support for bool: attribute namespace - @titoBouzout
* add "is" as detection for custom element - @titoBouzout
* fix missing exports in different envs - @trusktr
* better hydration mismatch errors - @ryansolid
* improved HTML validation of JSX partials - @titoBouzout
5 changes: 5 additions & 0 deletions .changeset/twenty-schools-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": patch
---

update TS to NodeNext
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
"@rollup/plugin-replace": "^5.0.2",
"@types/node": "^18.11.19",
"@vitest/coverage-c8": "^0.29.7",
"babel-plugin-jsx-dom-expressions": "^0.38.5",
"babel-plugin-jsx-dom-expressions": "^0.39.0",
"coveralls": "^3.1.1",
"csstype": "^3.1.0",
"dom-expressions": "0.38.6",
"hyper-dom-expressions": "0.38.6",
"dom-expressions": "0.39.0",
"hyper-dom-expressions": "0.39.0",
"jsdom": "^21.1.1",
"lit-dom-expressions": "0.38.6",
"lit-dom-expressions": "0.39.0",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "node test.js"
},
"dependencies": {
"babel-plugin-jsx-dom-expressions": "^0.38.5"
"babel-plugin-jsx-dom-expressions": "^0.39.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/h/jsx-runtime/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import h from "solid-js/h";
export type { JSX } from "./jsx";
import type { JSX } from "./jsx";
export type { JSX } from "./jsx.d.ts";
import type { JSX } from "./jsx.d.ts";

function Fragment(props: { children: JSX.Element }) {
return props.children;
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/h/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createHyperScript } from "./hyperscript";
import type { HyperScript } from "./hyperscript";
import { createHyperScript } from "./hyperscript.js";
import type { HyperScript } from "./hyperscript.js";
import {
spread,
assign,
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/html/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createHTML } from "./lit";
import type { HTMLTag } from "./lit";
import { createHTML } from "./lit.js";
import type { HTMLTag } from "./lit.js";
import {
effect,
style,
Expand Down
4 changes: 0 additions & 4 deletions packages/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
},
"main": "./dist/server.cjs",
"module": "./dist/server.js",
"browser": {
"./dist/server.cjs": "./dist/solid.cjs",
"./dist/server.js": "./dist/solid.js"
},
"unpkg": "./dist/solid.cjs",
"types": "types/index.d.ts",
"sideEffects": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/src/reactive/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ export function createRoot<T>(fn: RootFunction<T>, detachedOwner?: typeof Owner)
export type Accessor<T> = () => T;

export type Setter<in out T> = {
<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)): U;
<U extends T>(...args: undefined extends T ? [] : [value: (prev: T) => U]): undefined extends T
? undefined
: U;
<U extends T>(value: (prev: T) => U): U;
<U extends T>(value: Exclude<U, Function>): U;
<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)): U;
<U extends T>(value: (prev: T) => U): U;
};

export type Signal<T> = [get: Accessor<T>, set: Setter<T>];
Expand Down
4 changes: 0 additions & 4 deletions packages/solid/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"name": "solid-js/store",
"main": "./dist/server.cjs",
"module": "./dist/server.js",
"browser": {
"./dist/server.cjs": "./dist/store.cjs",
"./dist/server.js": "./dist/store.js"
},
"unpkg": "./dist/store.cjs",
"types": "./types/index.d.ts",
"type": "module",
Expand Down
18 changes: 18 additions & 0 deletions packages/solid/store/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import type { SetStoreFunction, Store } from "./store.js";

export type {
ArrayFilterFn,
DeepMutable,
DeepReadonly,
NotWrappable,
Part,
SetStoreFunction,
SolidStore,
Store,
StoreNode,
StorePathRange,
StoreSetter
} from "./store.js";

export const $RAW = Symbol("state-raw");

export function isWrappable(obj: any) {
Expand Down Expand Up @@ -103,6 +117,10 @@ export function createMutable<T>(state: T | Store<T>): T {
return state as T;
}

export function modifyMutable<T>(state: T, modifier: (state: T) => T) {
modifier(state);
}

type ReconcileOptions = {
key?: string | null;
merge?: boolean;
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 @@ -14,7 +14,7 @@ type DataNode = {
(): any;
$(value?: any): void;
};
type DataNodes = Record<PropertyKey, DataNode | undefined>;
export type DataNodes = Record<PropertyKey, DataNode | undefined>;

export type OnStoreNodeUpdate = (
state: StoreNode,
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/universal/src/universal.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "dom-expressions/src/universal";
export * from "dom-expressions/src/universal.js";
4 changes: 0 additions & 4 deletions packages/solid/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"name": "solid-js/web",
"main": "./dist/server.cjs",
"module": "./dist/server.js",
"browser": {
"./dist/server.cjs": "./dist/web.cjs",
"./dist/server.js": "./dist/web.js"
},
"unpkg": "./dist/web.cjs",
"types": "./types/index.d.ts",
"type": "module",
Expand Down
8 changes: 1 addition & 7 deletions packages/solid/web/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ export {
Match,
Index,
ErrorBoundary,
// This overrides mergeProps from dom-expressions/src/server.js
mergeProps
} from "solid-js";

export const isServer: boolean = true;
export const isDev: boolean = false;

export function render() {}
export function hydrate() {}
export function insert() {}
export function spread() {}
export function addEventListener() {}
export function delegateEvents(): void {}

export function Dynamic<T>(
props: T & { children?: any; component?: Component<T> | string | keyof JSX.IntrinsicElements }
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/web/src/client.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "dom-expressions/src/client";
export * from "dom-expressions/src/client.js";
Loading

0 comments on commit 81feefb

Please sign in to comment.