-
Notifications
You must be signed in to change notification settings - Fork 12k
Production build changes app behavior (some required code is removed from the bundle) #17494
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
Comments
Hi @alan-agius4 Please compare zoom animation in dev and prod builds. |
This is caused by the terser Terser is able to determine that 'Util.falseFn()' of leaflet is a pure function. It therefore knows it is safe to remove calls to it if the result is not used. It also knows that it needs to evaluate any arguments passed to said function, in case those have side effects. However, the Terser does not currently have any way to mark such impure property accesses as having side effects. See terser/terser#464. A workaround for the time being is to fork leaflet, and modify that line to read: |
Thanks @KevinCathcart, for your great explanation. At this point there is not much we can do about this. Let’s continue tracking this issue here: #15761 |
Agreed. Nothing more can be done on the Angular side, unless Angular enables an option to turn off |
Thanks!
For those, who use angular & leaflet. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Affected Package
The issue is caused by package @angular/....Is this a regression?
Not sure
Description
Leaflet library contains the following code:
https://github.com/Leaflet/Leaflet/blob/984fedda1c48d141f018ca45ae06738872d7f5dd/src/layer/tile/GridLayer.js#L393-L394
Looks like it's a kind of hack that forces a browser to update a page layout and to start the animation (css transition).
https://stackoverflow.com/a/24195559/1989716
In dev build everything works as expected.
When using
ng build --prod
mentioned above lines are removed from the bundle:this._setZoomTransform(i,r.getCenter(),r.getZoom()),this._onCreateLevel(i))
so the animation is broken.
Leaflet author closed the issue:
Leaflet/Leaflet#7096
Since angular and leaflet are both very popular, it would be great to provide a compatibility.
🌍 Your Environment
Angular Version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: