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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(core): use ngDevMode to tree-shake warnings #39959

Closed
wants to merge 1 commit into from
Closed

perf(core): use ngDevMode to tree-shake warnings #39959

wants to merge 1 commit into from

Conversation

arturovt
Copy link
Contributor

@arturovt arturovt commented Dec 3, 2020

This commit adds ngDevMode guard to show sanitization warnings only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The ngDevMode flag helps to tree-shake these warnings from production builds
(in dev mode everything will work as it works right now) to decrease production bundle size.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

  • Refactoring (no functional changes, no api changes)

Does this PR introduce a breaking change?

  • Yes
  • No

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good overall, thanks @arturovt, I just left a couple suggestions to take into account the fact that ngDevMode may be undeclared, so we should handle that. Thank you.

packages/core/src/sanitization/html_sanitizer.ts Outdated Show resolved Hide resolved
packages/core/src/sanitization/url_sanitizer.ts Outdated Show resolved Hide resolved
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: core Issues related to the framework runtime labels Dec 3, 2020
@ngbot ngbot bot added this to the needsTriage milestone Dec 3, 2020
@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Dec 3, 2020
@AndrewKushnir
Copy link
Contributor

Presubmit.

@pullapprove pullapprove bot requested a review from mhevery December 3, 2020 21:49
Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: global-approvers

@mhevery mhevery removed action: presubmit The PR is in need of a google3 presubmit action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 3, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Dec 3, 2020
@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Dec 3, 2020
@ngbot
Copy link

ngbot bot commented Dec 3, 2020

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "ci/circleci: test_aio_tools" is failing
    pending status "ci/circleci: test" is pending
    pending status "ci/circleci: test_aio" is pending
    pending status "ci/circleci: test_aio_local" is pending
    pending status "ci/circleci: test_aio_local_viewengine" is pending
    pending status "ci/circleci: test_win" is pending
    pending status "google3" is pending
    pending missing required status "ci/circleci: publish_snapshot"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: global-approvers

This commit adds `ngDevMode` guard to show sanitization warnings only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The `ngDevMode` flag helps to tree-shake these warnings from production builds
(in dev mode everything will work as it works right now) to decrease production bundle size.
@mhevery mhevery added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Dec 4, 2020
@mhevery mhevery closed this in 8b0cccc Dec 4, 2020
@mhevery mhevery added target: patch This PR is targeted for the next patch release and removed target: minor This PR is targeted for the next minor release labels Dec 4, 2020
mhevery pushed a commit that referenced this pull request Dec 4, 2020
This commit adds `ngDevMode` guard to show sanitization warnings only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The `ngDevMode` flag helps to tree-shake these warnings from production builds
(in dev mode everything will work as it works right now) to decrease production bundle size.

PR Close #39959
@arturovt arturovt deleted the guard-warnings-with-ng-dev branch December 4, 2020 18:31
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 4, 2021
@pullapprove pullapprove bot removed the area: core Issues related to the framework runtime label Jan 4, 2021
@ngbot ngbot bot removed this from the Backlog milestone Jan 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes core: performance target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants