Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

feat: switch to CDK BreakpointsObserver #685

Closed
1 of 5 tasks
CaerusKaru opened this issue Mar 20, 2018 · 9 comments · Fixed by #1006
Closed
1 of 5 tasks

feat: switch to CDK BreakpointsObserver #685

CaerusKaru opened this issue Mar 20, 2018 · 9 comments · Fixed by #1006
Assignees
Labels
feature P2 Issue that is important to resolve as soon as possible related: material2

Comments

@CaerusKaru
Copy link
Member

CaerusKaru commented Mar 20, 2018

We need to migrate to the CDK's layout engine. This means the following:

  • Switch to using BreakpointsObserver in MediaMonitor
  • Deprecate ObservableMedia/MediaService
  • Deprecate MatchMedia
  • Add server wrapper for BreakpointsObserver and MediaMatcher
  • Update the CDK layout engine as necessary
@CaerusKaru CaerusKaru added in-progress feature P2 Issue that is important to resolve as soon as possible best practices related: material2 labels Mar 20, 2018
@CaerusKaru CaerusKaru added this to the v6.0.0-beta.15 milestone Mar 20, 2018
@MarcusMorba
Copy link

@ThomasBurleson : we are currently updating to Angular 5 and want to test custom breakpoints. One thing which worries us is a possible dependence of material2 due to all of the overhead which comes with this and CDK. Can you give feedback which major dependencies are planned in the future for the use of custom breakpoints? Thanks.

@CaerusKaru
Copy link
Member Author

@MarcusMorba Only the CDK is a necessary dependency, due to the use of the CDK's Directionality service (and possibly their Layout service in the future). A dependency on Material is unlikely because it's only a collection of components with Material stylings, which is unnecessary for our agnostic layout library.

@MarcusMorba
Copy link

Thanks for your feedback.

@mackelito
Copy link

Does this mean that we can use the BreakpointObserver to control fxFlex properties?
I'm currently facing an issue where I want fxFlex="100vh" for handset and then use fxFlex.sm="600px" fxFlex.gt-sm="800px" for desktop.. is this something I can solve once this is implemented?

@CaerusKaru
Copy link
Member Author

@mackelito You might want to think about using the orientation breakpoints provided by this library. This will mostly be an internal-only change, meant specifically to reduce the size of the library source code (and duplicate code between Flex Layout and the CDK)

@mackelito
Copy link

@CaerusKaru I did take a look at it last night... sure I could use that.. just that we use the CDK implementation in several other places.. always looking for ways to be more consistent ;)

@alfaproject
Copy link

This would be amazeballs. @CaerusKaru are you planning this for a near future?

@CaerusKaru CaerusKaru modified the milestones: 7.0.0-beta.20, Backlog Nov 29, 2018
ThomasBurleson added a commit that referenced this issue Jan 23, 2019
@angular/cdk BreakpointObserver will not replace `MediaObserver`. **MediaObserver** is an enhanced version that notifies subscribers of activations for standard AND **overlapping (lt-xxx, gt-xxx)**  breakpoints.

* Ensure standard breakpoints mediaQueries are aligned with those in the CDK
* Update MediaObserver
  * isActive() enhanced to support list of aliases to determine if any match
  * properly disconnects subscribers when destroyed

> Note: Developers should use MediaObserver (not use MatchMedia) service to observe breakpoint activations! MediaObserver is the recommended service to use for application developers; MatchMedia should be considered a private service.

Fixes #685. Refs #1001.
@ThomasBurleson
Copy link
Contributor

@angular/cdk BreakpointObserver will not replace @angular/flex-layout MediaObserver. MediaObserver is an enhanced version that notifies subscribers of activations for standard AND
overlapping (lt-xxx, gt-xxx) breakpoints.

We are adding the following enhancements to @angular/flex-layout:

  • Ensure standard breakpoints mediaQueries are aligned with those in the CDK
  • Update MediaObserver
    • isActive() enhanced to support list of aliases to determine if any match
    • properly disconnects subscribers when destroyed

Note: Developers should use MediaObserver (not use MatchMedia) service to observe breakpoint activations! MediaObserver is the recommended service to use for application developers; MatchMedia should be considered a private service.

CaerusKaru pushed a commit that referenced this issue Jan 23, 2019
@angular/cdk BreakpointObserver will not replace `MediaObserver`. **MediaObserver** is an enhanced version that notifies subscribers of activations for standard AND **overlapping (lt-xxx, gt-xxx)**  breakpoints.

* Ensure standard breakpoints mediaQueries are aligned with those in the CDK
* Update MediaObserver
  * isActive() enhanced to support list of aliases to determine if any match
  * properly disconnects subscribers when destroyed

> Note: Developers should use MediaObserver (not use MatchMedia) service to observe breakpoint activations! MediaObserver is the recommended service to use for application developers; MatchMedia should be considered a private service.

Fixes #685. Refs #1001.
@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 Sep 5, 2019
@CaerusKaru CaerusKaru removed this from the Backlog milestone May 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature P2 Issue that is important to resolve as soon as possible related: material2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants