Component reloading - Previously, solid-refresh only allows single component reloading through export default. This change allows not only export default but every top-level component declaration (local included) to be reloaded.
Granular component preservation - This allows components in the same file to preserve lifecycles if it has not changed after module reload.
Code changes:
Rewrites the plugin into TypeScript (this changes the build config for rollup)
Removes the .jsx/.tsx filter to allow transforms through .js/.ts.
Removed ExportDefaultDeclaration transform and instead transforms VariableDeclarator and FunctionDeclaration at the top-level of the program, this means that this plugin can now handle multi-component hot transformation.
Adds pascal-case check as component heuristic.
Adds props identifier check for anonymous functions (implies anonmous components)
Side:
Migrate esm and standard to TypeScript
Add id and signature parameter to esm and standard
Questions:
Should I just use Program and transform the body instead of visiting VariableDeclarator and FunctionDeclaration directly?
How do we resolve $$registrations to prevent users from redefining?
Features:
export default
. This change allows not onlyexport default
but every top-level component declaration (local included) to be reloaded.Code changes:
.jsx
/.tsx
filter to allow transforms through.js
/.ts
.ExportDefaultDeclaration
transform and instead transformsVariableDeclarator
andFunctionDeclaration
at the top-level of the program, this means that this plugin can now handle multi-component hot transformation.Side:
esm
andstandard
to TypeScriptid
andsignature
parameter toesm
andstandard
Questions:
Program
and transform thebody
instead of visitingVariableDeclarator
andFunctionDeclaration
directly?$$registrations
to prevent users from redefining?