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

@google-cla google-cla bot added the cla: yes label Dec 3, 2020
@pullapprove pullapprove bot requested review from alxhub, IgorMinar, jelbourn and mhevery Dec 3, 2020
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

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 target: patch This PR is targeted for the next patch release comp: core Runtime issues labels Dec 3, 2020
@ngbot ngbot bot added this to the needsTriage milestone Dec 3, 2020
@AndrewKushnir AndrewKushnir added the action: presubmit A standard presubmit is running / required label Dec 3, 2020
@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Dec 3, 2020

Presubmit.

mhevery
mhevery approved these changes Dec 3, 2020
@pullapprove pullapprove bot requested a review from mhevery Dec 3, 2020
mhevery
mhevery approved these changes Dec 3, 2020
Copy link
Contributor

@mhevery mhevery left a comment

reviewed-for: global-approvers

@mhevery mhevery removed request for IgorMinar, jelbourn and alxhub Dec 3, 2020
@mhevery mhevery removed action: presubmit A standard presubmit is running / required action: review labels Dec 3, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Dec 3, 2020
@mhevery mhevery added the action: merge PR author is ready for this to merge label Dec 3, 2020
@ngbot
Copy link

@ngbot 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.

mhevery
mhevery approved these changes Dec 3, 2020
Copy link
Contributor

@mhevery mhevery left a comment

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 issue 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 Dec 4, 2020
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Jan 4, 2021

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 comp: core Runtime issues 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 PR author is ready for this to merge 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