Skip to content

overlapping type/function names are clobbered #76

Open

Description

@tmm1

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?

Activity

  1. tmm1 commented on Jan 14, 2025

    @tmm1
    Author

    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.

  2. lxsmnsyc commented on Jan 14, 2025

    @lxsmnsyc
    Member

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions