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

feat(platform-server): add getComputedStyle implementation #19856

Closed
wants to merge 1 commit into from

Conversation

ardatan
Copy link

@ardatan ardatan commented Oct 22, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Now getComputedStyle method can be used in platform-server with flex-layout etc.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@CaerusKaru
Copy link
Member

cc @vikerman, just like in #18362, this is needed for angular/flex-layout

@ardatan ardatan changed the title feat(platform-server): added getComputedStyle implementation feat(platform-server): add getComputedStyle implementation Oct 22, 2017
@vikerman
Copy link
Contributor

vikerman commented Oct 23, 2017

Hi - Sorry. I missed the previous one.

Can you explain a bit more as to what this PR is trying to do?

Also need tests

@vikerman vikerman self-assigned this Oct 23, 2017
@vikerman vikerman self-requested a review October 23, 2017 18:27
@vikerman vikerman added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 23, 2017
@CaerusKaru
Copy link
Member

@vikerman currently Domino doesn't provide an implementation for getComputedStyle on the server, which means that angular/flex-layout, which relies on this method, has to catch the thrown exception from this method when rendering.

This PR implements the method on the server, albeit so far without tests.

@ardatan
Copy link
Author

ardatan commented Oct 24, 2017

@CaerusKaru CI still gives error and I couldn’t get the error message.
By the way, I’ve added license header.

@CaerusKaru
Copy link
Member

@ardatan The Circle CI issue is a network timeout, probably because it couldn't access the yarn registry. Try resubmitting your commit (and you might want to rebase from master too).

You also need to add unit tests for your method (just to confirm that it works on server-generated elements).

@vikerman
Copy link
Contributor

Thanks. Overall makes sense. Will look into the implementation. Tests would be needed. Put the required ones at https://github.com/angular/angular/blob/master/packages/platform-server/test/integration_spec.ts

Thanks!

return '-' + match.toLowerCase();
}

export class ɵCSSStyleDeclaration {
Copy link

@LinboLen LinboLen Oct 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curiously, what is this ɵ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a private method identifier. It's an Angular convention. You can find it anywhere, every package uses it.

@vikerman vikerman added the area: server Issues related to server-side rendering label Oct 30, 2017
@CaerusKaru
Copy link
Member

It looks like CSSStyleDeclaration is already implemented by Domino. Can you patch this PR to simply rely on that method?

If that's not the case (and their impl. is insufficient), it might be worth implementing the patch in Domino itself instead of here.

@jasonaden jasonaden added this to the needsTriage milestone Jan 29, 2019
@AndrewKushnir
Copy link
Contributor

Closing this PR based on #19856 (comment).

@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 Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer area: server Issues related to server-side rendering cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants