solid-refresh
solid-refresh copied to clipboard
overlapping type/function names are clobbered
i'm working an complicated build pipeline where i added solid-refresh babel plugin, and encountered the following issue when solid-primitives/refs is processed:
solid-primitives/refs/refs.ts(98,9): Property 'ref' of exported interface has or is using private name 'Ref'.
comparing the generated files, you can see the difference:
w/out solid-refresh:
export type Ref<T> = T | ((el: T) => void) | undefined;
export interface RefProps<T> {
export function mergeRefs<T>(...refs: Ref<T>[]): (el: T) => void {
export function Refs(props: {
export function Ref(props: {
w/ solid-refresh:
export type Ref<T> = T | ((el: T) => void) | undefined;
export interface RefProps<T> {
export function mergeRefs<T>(...refs: Ref<T>[]): (el: T) => void {
export { Refs };
export { Ref };
Probably the solution and expected behavior is that library code like solid-primitives would not be processed via the solid-refresh babel pipeline?
Was struggling to edit my babel config to skip the solid-refresh plugin for this one file.
But then I realized I can just add a // @refresh skip to the top.
hmmm interesting, this is a good issue.
This happens because we hoist the functions at the top so we can wrap them later on with refresh, but never did I took TypeScript's same name feature into consideration