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

Remove private Angular API usage #193

Closed
IgorMinar opened this issue Feb 22, 2017 · 4 comments · Fixed by #195
Closed

Remove private Angular API usage #193

IgorMinar opened this issue Feb 22, 2017 · 4 comments · Fixed by #195
Assignees
Labels
bug has pr A PR has been created to address this issue P0 Critical issue that needs to be resolved immediately
Milestone

Comments

@IgorMinar
Copy link

When testing Angular 4 in google3 we discovered that flex-layout uses private APIs from @angular/core. These apis are no longer available in A4. Please remove the usage:

import {__platform_browser_private__} from '@angular/platform-browser';
const getDOM = __platform_browser_private__.getDOM;

let value = (element.style as any)['display'] || getDOM().getComputedStyle(element)['display'];

in google3 we made the following local modification:

before:

import {ElementRef, Renderer, OnDestroy} from '@angular/core';

import {__platform_browser_private__} from '@angular/platform-browser';
const getDOM = __platform_browser_private__.getDOM;

import {applyCssPrefixes} from '../../utils/auto-prefixer';

...

    let value = (element.style as any)['display'] || getDOM().getComputedStyle(element)['display'];

after:

import {ElementRef, Renderer, OnDestroy} from '@angular/core';

import {applyCssPrefixes} from '../../utils/auto-prefixer';

...

    let value = (element.style as any)['display'] || getComputedStyle(element)['display'];

please note that the global window object has getComputedStyle which getDOM delegated the call, so this modification is equivalent to the original both at design time and at run time.

@ThomasBurleson
Copy link
Contributor

ThomasBurleson commented Feb 22, 2017

@IgorMinar - Can you provide some insight how Angular Universal addresses calls such as the previous getDOM() and now the implicit window.getComputedStyle(....) ?

Darn it... you beat us to this effort. Notice we already had #191: "Publish a version supporting Angular 4.x" in the queue.

@ThomasBurleson ThomasBurleson added this to the v2.0.0-rc.1 milestone Feb 22, 2017
@ThomasBurleson ThomasBurleson self-assigned this Feb 22, 2017
@ThomasBurleson ThomasBurleson added bug P0 Critical issue that needs to be resolved immediately labels Feb 22, 2017
@ThomasBurleson
Copy link
Contributor

Refs #191

@ThomasBurleson ThomasBurleson changed the title remove private api usage Remove private Angular API usage Feb 22, 2017
ThomasBurleson added a commit that referenced this issue Feb 22, 2017
**flex-layout** uses private APIs from @angular/core. These apis are no longer available in A4.

NOTE: `custom-matchers.ts` still uses the private API for Angular 2.x unit testing. Further work is need to identify a reasonable work-around for all versions of Angular.

Fixes #193.
@ThomasBurleson ThomasBurleson added the has pr A PR has been created to address this issue label Feb 22, 2017
ThomasBurleson added a commit that referenced this issue Feb 22, 2017
**flex-layout** uses private APIs from @angular/core. These apis are no longer available in A4.

NOTE: `custom-matchers.ts` still uses the private API for Angular 2.x unit testing. Further work is need to identify a reasonable work-around for all versions of Angular.

Fixes #193.
mmalerba pushed a commit that referenced this issue Feb 22, 2017
**flex-layout** uses private APIs from @angular/core. These apis are no longer available in A4.

NOTE: `custom-matchers.ts` still uses the private API for Angular 2.x unit testing. Further work is need to identify a reasonable work-around for all versions of Angular.

Fixes #193.
@IgorMinar
Copy link
Author

@vikerman can help with the universal support question.

karlhaas pushed a commit to karlhaas/flex-layout that referenced this issue May 3, 2017
**flex-layout** uses private APIs from @angular/core. These apis are no longer available in A4.

NOTE: `custom-matchers.ts` still uses the private API for Angular 2.x unit testing. Further work is need to identify a reasonable work-around for all versions of Angular.

Fixes angular#193.
@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 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug has pr A PR has been created to address this issue P0 Critical issue that needs to be resolved immediately
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants