Skip to content

Commit

Permalink
update deps, fix #2144, fix #2145, fix #2178, fix #2192
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Jun 27, 2024
1 parent 63c10ba commit 6693b56
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 47 deletions.
8 changes: 8 additions & 0 deletions .changeset/chatty-mugs-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"babel-preset-solid": patch
"solid-js": patch
"solid-element": patch
---

update TS, custom elements, and a lot compiler fixes
fixes #2144, #2145, #2178, #2192
10 changes: 5 additions & 5 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.37.20",
"babel-plugin-jsx-dom-expressions": "^0.37.23",
"coveralls": "^3.1.1",
"csstype": "^3.1.0",
"dom-expressions": "0.37.20",
"hyper-dom-expressions": "0.37.20",
"dom-expressions": "0.37.23",
"hyper-dom-expressions": "0.37.23",
"jsdom": "^21.1.1",
"lit-dom-expressions": "0.37.20",
"lit-dom-expressions": "0.37.23",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
Expand All @@ -53,7 +53,7 @@
"symlink-dir": "^5.0.1",
"tsconfig-replace-paths": "^0.0.11",
"turbo": "^1.3.1",
"typescript": "^4.9.5",
"typescript": "^5.5.2",
"vite-plugin-solid": "^2.6.1",
"vitest": "^0.29.3"
},
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.37.20"
"babel-plugin-jsx-dom-expressions": "^0.37.23"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build": "pnpm run clean && tsc"
},
"dependencies": {
"component-register": "~0.8.2"
"component-register": "~0.8.5"
},
"peerDependencies": {
"solid-js": "^1.8.17"
Expand Down
6 changes: 3 additions & 3 deletions packages/solid-element/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ function withSolid<T extends object>(ComponentType: ComponentType<T>): Component
function customElement<T extends object>(
tag: string,
ComponentType: ComponentType<T>
): (ComponentType: ComponentType<T>) => any;
): CustomElementConstructor;
function customElement<T extends object>(
tag: string,
props: PropsDefinitionInput<T>,
ComponentType: ComponentType<T>
): (ComponentType: ComponentType<T>) => any;
): CustomElementConstructor;
function customElement<T extends object>(
tag: string,
props: PropsDefinitionInput<T> | ComponentType<T>,
ComponentType?: ComponentType<T>
): (ComponentType: ComponentType<T>) => any {
): CustomElementConstructor {
if (arguments.length === 2) {
ComponentType = props as ComponentType<T>;
props = {} as PropsDefinitionInput<T>;
Expand Down
15 changes: 5 additions & 10 deletions packages/solid/test/component.type-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,12 @@ function M4<T extends keyof M4Type = "a">(
test2.test = "";

const test3 = mergeProps(defaultProperties, ...[props]);
// @ts-expect-error prop could be string if props is empty
const prop3: "a" | "b" = test3.prop;
const propstr3: string = test3.prop;
const as3: T = test3.as!;
const str3: string = test3.test!;
test3.prop = "a";
// @ts-expect-error it doesn't need to be assignable, regardless this shouldn't error
test3.as = "" as T;
// @ts-expect-error it doesn't need to be assignable, regardless this shouldn't error
test3.test = "";

const test4 = mergeProps(...[defaultProperties], props);
Expand All @@ -140,9 +137,7 @@ function M4<T extends keyof M4Type = "a">(
const as5: T = test5.as;
const str5: string = test5.test;
test5.prop = "a";
// @ts-expect-error it doesn't need to be assignable, regardless this shouldn't error
test5.as = "" as T;
// @ts-expect-error it doesn't need to be assignable, regardless this shouldn't error
test5.test = "";

const test6 = mergeProps(props, props);
Expand All @@ -163,23 +158,23 @@ function M4<T extends keyof M4Type = "a">(
// m5-m7: mergeProps spreading arrays is valid
const m5 = mergeProps(a, ...[b], c);
type M5 = typeof m5;
type TestM5 = Assert<IsExact<M5, { a: number; b?: number; c: number }>>;
type TestM5 = Assert<IsExact<M5, { a: number; b: number; c: number }>>;

const m6 = mergeProps(...[b], c);
type M6 = typeof m6;
type TestM6 = Assert<IsExact<M6, { b?: number; c: number }>>;
type TestM6 = Assert<IsExact<M6, { b: number; c: number }>>;

const m7 = mergeProps(a, ...[b]);
type M7 = typeof m7;
type TestM7 = Assert<IsExact<M7, { a: number; b?: number }>>;
type TestM7 = Assert<IsExact<M7, { a: number; b: number }>>;

const m8 = mergeProps(...[b]);
type M8 = typeof m8;
type TestM8 = Assert<IsExact<M8, { b?: number }>>;
type TestM8 = Assert<IsExact<M8, { b: number }>>;

const m9 = mergeProps(...[a], ...[b], ...[c]);
type M9 = typeof m9;
type TestM9 = Assert<IsExact<M9, { a?: number; b?: number; c?: number }>>;
type TestM9 = Assert<IsExact<M9, { a: number; b: number; c: number }>>;
}

// s1-s3: splitProps return type is correct regardless of usage
Expand Down
64 changes: 37 additions & 27 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6693b56

Please sign in to comment.