astro-repl icon indicating copy to clipboard operation
astro-repl copied to clipboard

component filename increment problem and default import

Open sprabowo opened this issue 4 years ago • 2 comments

  • component filename increment problem Step to reproduce:
  1. Add new component => shown component.astro
  2. Add new component => shown component1.astro
  3. delete component.astro
  4. create new component => shown component.astro
  5. create new component (❌ user couldn't add new component)

screenshot: astro pr

  • removing default import when add new component just thought that if we add default import syntax to Page.astro, it could be a problem in the future when user delete component.astro, import syntax is still there. my suggestion was keep user importing manually since the mental model from developer to just import when it's needed (this behavior is common in svelte repl)

sprabowo avatar Sep 16 '21 06:09 sprabowo

Or perhaps a button when on the Component.astro "tab" that when manually clicked adds the import statement to the top of Page.astro. Would be helpful if it switched you back to Page.astro and highlighted the added line.

leoj3n avatar Feb 14 '22 20:02 leoj3n

@leoj3n That might work, I'll see if there is a way to implement something like that

okikio avatar Feb 15 '22 03:02 okikio