Comments (8)
How about decoupling the core icon package and the Angular package to make life easier?
It's planned, see #1687
Once we do that, there will be nothing in the way of releasing a modern version of lucide-angular
with proper standalone component support.
from lucide.
How about decoupling the core icon package and the Angular package to make life easier?
from lucide.
Hi @hakimio,
This isn't really an issue with lucide-angular
, this is just how Angular works. Standalone components have no support for ModuleWithProvider
declarations, if you want to use Lucide with standalone components, you already can do it, see: #1288 (comment)
Of course it would be best if we could provide a standalone component, but we can't as long as we want to retain backwards compatibility with previous versions.
Due to performance reasons I also highly advise against injecting a list of icons within every standalone component and relying instead of tree-shaken single imports (basically: only provide icons to a standalone component that the component actually uses).
from lucide.
Using importProvidersFrom()
is not a proper solution. That's just a workaround.
You can provide your own provideLucideIcons(appIcons)
at least in addition to LucideAngularModule.pick()
. It wouldn't break anything.
from lucide.
Also, you can release a new major version of lucide-angular
with breaking changes. I don't understand why in more than 3 years you haven't released any major version and kept going with 0.x
releases.
from lucide.
makeEnvironmentProviders is available since Angular v15
. Older Angular versions are not supported.
from lucide.
Using importProvidersFrom() is not a proper solution. That's just a workaround. You can provide your own provideLucideIcons(appIcons) at least in addition to LucideAngularModule.pick(). It wouldn't break anything.
importProvidersFrom
is not something that we recommend using at all, we recommend using the dedicated injection token for this purpose as stated in #1288 (comment)
But even moreso we recommend not providing more icons than necessary, so I'd recommend using this pattern:
import { Component } from '@angular/core';
import { ActivitySquareIcon, LucideAngularModule } from 'lucide-angular';
@Component({
selector: 'app-demo',
standalone: true,
imports: [LucideAngularModule],
template: `<lucide-icon [name]="ActivitySquareIcon" />`,
})
export class DemoComponent {
protected readonly ActivitySquareIcon = ActivitySquareIcon;
}
Also, you can release a new major version of lucide-angular with breaking changes.
Every icon is bundled within the package, should we release a new version with breaking changes, people using earlier versions of Angular would be hung out to dry, and if you look at the usage statistics of major versions, people do still use earlier versions, a lot: https://www.npmjs.com/package/@angular/core?activeTab=versions.
from lucide.
Awesome 🙂
from lucide.
Related Issues (20)
- Parallelogram HOT 3
- svelte-check error when using ComponentType<Icon> HOT 6
- Documentation for icon font does not respect case sensitive systems
- icon request: `index-card` HOT 1
- React 19 support HOT 3
- transparent icons show overlapping internal shapes HOT 2
- 0.378.0 introduced a hydration bug that can be seen when using nextjs or remix
- Module '"lucide-react"' has no exported member 'Notebook'.ts(2305) HOT 3
- Breaking changes between `lucide-static@307` and `lucide-static@308+` (package moved to ESM)
- Git icon HOT 8
- Map Pin Plus
- Creating new icons triggers 'unique "key" prop' error HOT 3
- Drone icon HOT 2
- List Check Icon HOT 2
- Figma plugin keeps loading and won't run HOT 6
- X-(Twiiter) New Logo HOT 1
- Icon Request: Cloud Checked Icon HOT 3
- Time Picker
- Find renamed icons HOT 1
- `Angular 18` peer dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lucide.