Angular: Support ::ng-deep as an alternative to /deep/

Created on 12 Jun 2017  Â·  5Comments  Â·  Source: angulardart/angular

Angular will need some replacement
sass/dart-sass#154

compiler syncing âš  PRIORITY dev cycle new user

Most helpful comment

We've decided to deprecate /deep/ and >>>, and support ::ng-deep as a drop-in.

Here is our internal test case for this feature:

  test('should handle ::ng-deep', () {
    var css = '::ng-deep y {}';
    shimAndExpect(css, 'y {}');
    css = 'x ::ng-deep y {}';
    shimAndExpect(css, 'x.$content y {}');
    css = ':host > ::ng-deep .x {}';
    shimAndExpect(css, '.$host > .x {}');
    css = ':host ::ng-deep > .x {}';
    shimAndExpect(css, '.$host > .x {}');
    css = ':host > ::ng-deep > .x {}';
    shimAndExpect(css, '.$host > > .x {}');
  });

We've gotten confirmation this will be supported (parsable) in all major SASS tooling.

AngularDart 4.x.x will be the last major release to support either /deep/ or >>> (both, including ::ng-deep, will be available in 4.0). As a result, _native_ shadow DOM will also be deprecated (but not immediately removed), since there is no way after Chrome's /deep/ deprecation lands, and we don't have another story (yet).

NOTE: We will back-port and release 3.2.0 to unblock our users, but other packages (like angular_components) will need to be updated too in order to take advantage of this fully.

All 5 comments

We have a number of ideas, but nothing I'm able to publish yet. Will update soon.

That's what I wanted to hear, that it's on your radar. No need to provide details right now.

We've decided to deprecate /deep/ and >>>, and support ::ng-deep as a drop-in.

Here is our internal test case for this feature:

  test('should handle ::ng-deep', () {
    var css = '::ng-deep y {}';
    shimAndExpect(css, 'y {}');
    css = 'x ::ng-deep y {}';
    shimAndExpect(css, 'x.$content y {}');
    css = ':host > ::ng-deep .x {}';
    shimAndExpect(css, '.$host > .x {}');
    css = ':host ::ng-deep > .x {}';
    shimAndExpect(css, '.$host > .x {}');
    css = ':host > ::ng-deep > .x {}';
    shimAndExpect(css, '.$host > > .x {}');
  });

We've gotten confirmation this will be supported (parsable) in all major SASS tooling.

AngularDart 4.x.x will be the last major release to support either /deep/ or >>> (both, including ::ng-deep, will be available in 4.0). As a result, _native_ shadow DOM will also be deprecated (but not immediately removed), since there is no way after Chrome's /deep/ deprecation lands, and we don't have another story (yet).

NOTE: We will back-port and release 3.2.0 to unblock our users, but other packages (like angular_components) will need to be updated too in order to take advantage of this fully.

@leonsenft Was this included as part of #471 ?

@alorenzen Yes it was. Looks like it got swallowed up by https://github.com/dart-lang/angular/commit/302c3865c68a7ed5277a1804aea772be4b0f0df6 and we lost the commit message.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chalin picture chalin  Â·  3Comments

ranquild picture ranquild  Â·  4Comments

AndreyChernykh picture AndreyChernykh  Â·  4Comments

jrote1 picture jrote1  Â·  6Comments

matanlurey picture matanlurey  Â·  4Comments