You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are relevant/related to the feature request?
common
Description
Commit 801daf8 added assertions against using blob: and data: URL's. for NgOptimizedImage.
I cannot find any reasoning provided in either the documentation for the NgOptimizedImage directive 12 nor in the source changes. The documentation makes it seem like 'ngSrc' is a drop-in-replacement for the src attribute with no warning or indication that there are significant regressions in functionality when using it as such. Note: IDE's such as JetBrains Webstorm actively lint against using src and suggest replacing it with ngSrc in Angular projects.
Removing these assertions shows expected behavior without any issues. So why was this introduced? Maybe there is a great reason for these changes... the commit description provides 0 insight and the error message asking users to simply stop using it is not a fantastic UX.
Proposed solution
Revert the commit and allow those inputs. Happy to do a PR but would like confirmation that there isn't some special reasons for this constraint first.
Alternatives considered
Add documentation to:
The directive documentation outlining there are clear caveats and regressions going from ngSrc to src.
The source logic indicating why these assertions are needed (a simple one liner like // These types conflict with Foo logic, so we prevent them from being used helps posterity tremendously).
The text was updated successfully, but these errors were encountered:
Which @angular/* package(s) are relevant/related to the feature request?
common
Description
Commit 801daf8 added assertions against using blob: and data: URL's. for NgOptimizedImage.
I cannot find any reasoning provided in either the documentation for the NgOptimizedImage directive 1 2 nor in the source changes. The documentation makes it seem like 'ngSrc' is a drop-in-replacement for the
src
attribute with no warning or indication that there are significant regressions in functionality when using it as such. Note: IDE's such as JetBrains Webstorm actively lint against usingsrc
and suggest replacing it withngSrc
in Angular projects.Removing these assertions shows expected behavior without any issues. So why was this introduced? Maybe there is a great reason for these changes... the commit description provides 0 insight and the error message asking users to simply stop using it is not a fantastic UX.
Proposed solution
Revert the commit and allow those inputs. Happy to do a PR but would like confirmation that there isn't some special reasons for this constraint first.
Alternatives considered
Add documentation to:
// These types conflict with Foo logic, so we prevent them from being used
helps posterity tremendously).The text was updated successfully, but these errors were encountered: