Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overlapping type/function names are clobbered #76

Open
tmm1 opened this issue Jan 13, 2025 · 2 comments
Open

overlapping type/function names are clobbered #76

tmm1 opened this issue Jan 13, 2025 · 2 comments

Comments

@tmm1
Copy link

tmm1 commented Jan 13, 2025

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?

@tmm1
Copy link
Author

tmm1 commented Jan 14, 2025

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.

@lxsmnsyc
Copy link
Member

lxsmnsyc commented Jan 14, 2025

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants