solidjs / solidjs/solid-vite-plugin
Proxied Functions Do Not Handle Spreading
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 520
- Forks
- 70
- Avg merge
- 23h 35m
- Merged PRs (30d)
- 39
Description
The Spreading syntax does not work the same way as it does in normal javascript. The spreading (...) syntax of an array into a function gives the wrong value. When imported from a .js file, the function behaves as expected, however when imported from a .jsx file, the function only puts the first value of the array into a new array.
How To Reproduce
-> Create a new vanilla Solid-js application.
-> Create a new jsx file, and make a function that uses the spread
-> call the spreaded function from any other file I.E(the default app)
-> Changing the file extension back to js, changes the behavior.
Minimum Reproduction
//In a File, the source function
function GlobalTest(...arr){
console.log(...arr);
}
//Inside of app.jsx
import {GlobalTest} from 'otherfile'
GlobalTest(1,2,3); // should see a '1' in the log when the source function is in a .jsx
GlobalTest(1,2,3); // should see a '1 2 3' in the log when the source function is in a .js
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproduction, comparing how the source function is processed when it is in a .jsx file versus a .js file. Trace the plugin's handling of the spread syntax and verify the fix by running the reproduction: GlobalTest(1,2,3) should preserve and log all three arguments from either extension.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100