solidjs / solid

A declarative, efficient, and flexible JavaScript library for building user interfaces.
https://solidjs.com
MIT License
32.05k stars 914 forks source link

`mergeProps` return type is broken when using generics and intersections types #982

Closed riccardoperra closed 2 years ago

riccardoperra commented 2 years ago

Describe the bug

I'm trying to upgrade my application to Solid 1.4.0 but I am having troubles related to the new mergeProps return type which broke some types inside my ui components library https://github.com/riccardoperra/codeimage/runs/6428736073?check_suite_focus=true

The result of the mergeProps function is ok for the most cases, but when using types that depends on generics, some properties are missing or completely broken. To me this seems related to a typescript core issue, but I think some of solid types can be improved to try to handle these errors, even if not all

Your Example Website or App

https://playground.solidjs.com/?hash=-238626028&version=1.4.1

Steps to Reproduce the Bug or Issue

Here's a playground

https://playground.solidjs.com/?hash=-238626028&version=1.4.1

It consists of:

Expected behavior

Solid 1.3.4 was not throwing that error.

Screenshots or Videos

image

Platform

Additional context

A pr with the possible fix #983

ryansolid commented 2 years ago

Should be fixed in 1.4.2. Thanks for the PR.