lucide icon indicating copy to clipboard operation
lucide copied to clipboard

Mark Angular component as "standalone: false"

Open Martinspire opened this issue 1 month ago • 6 comments

Package

  • [ ] lucide
  • [x] lucide-angular
  • [ ] lucide-flutter
  • [ ] lucide-preact
  • [ ] lucide-react
  • [ ] lucide-react-native
  • [ ] lucide-solid
  • [ ] lucide-svelte
  • [ ] lucide-vue
  • [ ] lucide-vue-next
  • [ ] Figma plugin
  • [ ] source/main
  • [ ] other/not relevant

Version

0.473.0

Can you reproduce this in the latest version?

  • [x] Yes
  • [ ] No

Browser

  • [x] Chrome/Chromium
  • [ ] Firefox
  • [ ] Safari
  • [ ] Edge
  • [ ] iOS Safari
  • [ ] Opera
  • [ ] Other/not relevant

Operating system

  • [x] Windows
  • [ ] Linux
  • [ ] macOS
  • [ ] ChromeOS
  • [ ] iOS
  • [ ] Android
  • [ ] Other/not relevant

Description

With Angular 19, all components are assumed to be Standalone. But while the version is supported as a dependency, the component is still breaking support by not explicitly setting standalone.

Since the issue about making the library standalone isn't going anywhere and lots of stuff is planned but not yet executed, there's issues with the current approach for when you want to write tests.

In Angular its common to use NG-Mocks for testing, but that currently doesn't know that the component is standalone. It gives a similar error as this: https://github.com/help-me-mom/ng-mocks/issues/10762 for Lucide

There's a discussion happening with ng-mocks but no real solution is out yet, but this project should still set the value to make sure people also know it isn't a standalone dependency yet.

Steps to reproduce

  1. Import module in your project
  2. Use icon somewhere
  3. Write test and either include or mock the library (it doesn't seem to matter as far as I know)
  4. Unit tests break because component is assumed to be standalone but still imported in an ngmodule.

Checklist

  • [x] I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)

Martinspire avatar Jan 22 '25 07:01 Martinspire