Skip to content

refactor(platform-browser): avoid mutable exports. - #34207

Closed
mprobst wants to merge 1 commit into
angular:masterfrom
mprobst:browserdetect-const
Closed

mprobst wants to merge 1 commit into
angular:masterfrom
mprobst:browserdetect-const

Conversation

@mprobst

@mprobst mprobst commented Dec 3, 2019

Copy link
Copy Markdown
Contributor

Previously, browser_util would export a mutable let binding that was
initialized as a side-effect of BrowserDetection.setup(). This change
refactors the mutable binding into a const binding that is immediately
initialized in its initialized.

This is functionally equivalent, but makes it easier for module
optimizers such as Closure Compiler to track down side effects and prune
modules. It is also arguably cleaner to read (no worries about later
changes to the apparently mutable but effectively const binding).

  • Refactoring (no functional changes, no api changes)

Previously, browser_util would export a mutable `let` binding that was
initialized as a side-effect of `BrowserDetection.setup()`. This change
refactors the mutable binding into a `const` binding that is immediately
initialized in its initialized.

This is functionally equivalent, but makes it easier for module
optimizers such as Closure Compiler to track down side effects and prune
modules. It is also arguably cleaner to read (no worries about later
changes to the apparently mutable but effectively const binding).
@mprobst
mprobst requested a review from a team December 3, 2019 08:20
@mprobst
mprobst requested a review from kara December 3, 2019 08:20
@mhevery mhevery added area: core Issues related to the framework runtime action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release labels Dec 3, 2019
@ngbot ngbot Bot modified the milestone: needsTriage Dec 3, 2019
@mhevery

mhevery commented Dec 3, 2019

Copy link
Copy Markdown
Contributor

presubmit

@mprobst
mprobst removed the request for review from kara December 4, 2019 09:08
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 5, 2020
AndrewKushnir pushed a commit to AndrewKushnir/angular that referenced this pull request Jan 24, 2020
Previously, browser_util would export a mutable `let` binding that was
initialized as a side-effect of `BrowserDetection.setup()`. This change
refactors the mutable binding into a `const` binding that is immediately
initialized in its initialized.

This is functionally equivalent, but makes it easier for module
optimizers such as Closure Compiler to track down side effects and prune
modules. It is also arguably cleaner to read (no worries about later
changes to the apparently mutable but effectively const binding).

PR Close angular#34207
AndrewKushnir pushed a commit that referenced this pull request Jan 24, 2020
Previously, browser_util would export a mutable `let` binding that was
initialized as a side-effect of `BrowserDetection.setup()`. This change
refactors the mutable binding into a `const` binding that is immediately
initialized in its initialized.

This is functionally equivalent, but makes it easier for module
optimizers such as Closure Compiler to track down side effects and prune
modules. It is also arguably cleaner to read (no worries about later
changes to the apparently mutable but effectively const binding).

PR Close #34207

PR Close #34960
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 area: core Issues related to the framework runtime cla: yes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants