Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce different levels for the optimization build option #15761

Open
filipesilva opened this issue Oct 4, 2019 · 5 comments
Open

Introduce different levels for the optimization build option #15761

filipesilva opened this issue Oct 4, 2019 · 5 comments
Labels
area: devkit/build-angular feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature Issue that requests a new feature
Milestone

Comments

@filipesilva
Copy link
Contributor

filipesilva commented Oct 4, 2019

馃殌 Feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

Introduce different levels for the optimization build option.

Describe the solution you'd like

We should have a way to disable unsafe optimizations, such as pure_getters.

Describe alternatives you've considered

Either having several levels (e.g. true > 'safe-only' > false) or having a per-option switch on a object.

Related issues:
#14187
#14287
#14316
#15607
#15751
#17255
#17494

@cloakedninjas
Copy link

Also related: #11439

@dgp1130
Copy link
Collaborator

dgp1130 commented Jun 4, 2020

Terser discussion of working around pure_getters: terser/terser#464

@laurentgoudet
Copy link

Originally posted by @alan-agius4 in #17517 (comment)

This was one of the changes in version 9 where server production code is minified, one of the main reasons behind this is to speed up server cold starts and reduce deployment times.
What I suggest is to generate sourcemaps and attach them, which will provide a better debug experience.

This is what I'm doing for Sentry, which works reasonably well (shipping the source maps to Sentry in CI), but I'm also shipping server-side logs to an ELK stack - with minified code those would show meaningless stack traces.

One way around could be to embed the source maps into the prod container & apply those on the error stack traces, but I'd rather not have that kind of logic running on errors, in order to ensure those are properly reported (and not swallowed), plus that'd defeat a bit the goal of reducing deployment times.

Not sure how others have solve these problems as the cold starts time & memory usage are indeed quite large (especially when running a 30+ locales app), but for the moment I'd still be interested by a proper way to turn off server-side code minification (a rollup pass or anything that does not make the code unreadable is fine though).

@angular-robot
Copy link
Contributor

angular-robot bot commented May 5, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@ngbot ngbot bot modified the milestones: Backlog, needsTriage May 5, 2022
@angular-robot
Copy link
Contributor

angular-robot bot commented May 24, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors and removed feature: votes required Feature request which is currently still in the voting phase labels May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: devkit/build-angular feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

4 participants