Closed danieltroger closed 10 months ago
I think this is a SolidRefresh issue, specifically to do with HMR wrappers. I don't know how easy it is to fix given we have to wrap every exported function in a wrapper. I'm gathering we have to do the old CoffeeScript trick of doing all the var declarations up top. I will move it to the right repo.
I'm still not sure what would be the fix for this. I'm thinking if Solid Refresh should move all FunctionDeclaration
at the top and maybe that would fix the issue.
edit: I just noticed Ryan had the same idea as I didn't read it lol.
Duplicates
Latest version
Current behavior 😯
Right now, solid-start in dev mode transforms function statements to
var
statements, without considering function hoisting. This can break code, as can be seen in the reproduction steps.Expected behavior 🤔
Valid javascript code should still run in dev mode
Steps to reproduce 🕹
Steps:
yarn dev
Context 🔦
I prefer having the exported thing at the top of modules. Like in the attached example I have a case where I want to add a symbol to a function, however I have to do it in an IIFE in the export so that I can add a pure comment and the module still can be tree-shaken.
Your environment 🌎