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(ivy): introduce the animate pipe for styling bindings #26931

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Nov 2, 2018

No description provided.

@matsko matsko force-pushed the animate_pipe branch 3 times, most recently from 39d8bef to 8cd7e9b Compare November 2, 2018 22:53
@matsko matsko added the target: major This PR is targeted for the next major release label Nov 2, 2018
@mary-poppins
Copy link

You can preview 7f1a9be at https://pr26931-7f1a9be.ngbuilds.io/.

}

export function now(): number {
return window ? window.performance && window.performance.now() : Date.now();
Copy link
Member

Choose a reason for hiding this comment

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

There's a bug here, should be:

Suggested change
return window ? window.performance && window.performance.now() : Date.now();
return window && window.performance && window.performance.now() || Date.now();

playerContext[index] = null;
} else {
playerContext.splice(index, 1);
player.status.subscribe(state => {
Copy link
Member

Choose a reason for hiding this comment

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

This subscription is not unsubscribed from, nor is the status Subject being completed, so this will probably leak by the looks of it.

export function computeStyle(element: HTMLElement, prop: string): string {
if (!window || !window.getComputedStyle) return '';
const gcs = window.getComputedStyle(element);
let val = (gcs as any)[prop];
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
let val = (gcs as any)[prop];
const val = (gcs as any)[prop] || gcs.getPropertyValue(prop);

const bool = classes[className];
element.classList.toggle(className, revert ? !bool : bool);
if (store) {
store[className] = revert ? false : true;
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
store[className] = revert ? false : true;
store[className] = !revert;


function applyStyleChanges(
element: HTMLElement, styles: {[key: string]: any}, backupStyles: {[key: string]: any} | null,
revert?: boolean, store?: {[key: string]: any} | null) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: what I think is strange is that backupStyles is not optional, whereas its read is conditional on the optional revert param being true.

packages/core/src/render3/animations/util.ts Outdated Show resolved Hide resolved
packages/core/src/render3/animations/animate_pipe.ts Outdated Show resolved Hide resolved
packages/core/src/render3/animations/interfaces.ts Outdated Show resolved Hide resolved
scheduleFlush(): void;
flushEffects(): boolean;
destroy(): void;
onAllEffectsDone(cb: () => any): void;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
onAllEffectsDone(cb: () => any): void;
onAllEffectsDone(cb: () => void): void;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed so you can do something like onAllEffectsDone(x => foo()); (incase foo() returns something ... otherwise typings would fail)

Copy link
Member

@gkalpak gkalpak Nov 6, 2018

Choose a reason for hiding this comment

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

It is perfectly fine to use a function with a non-void return type in place of a () => void function (e.g. see microsoft/TypeScript#20006 (comment)).
(There are discussions about changing that, but I don't see it as likely in the near future - famous last words.)

If you wanted to be fancy (and safe), you could use () => unknown 😛

@kara kara added the comp: ivy label Nov 5, 2018
@ngbot ngbot bot added this to the needsTriage milestone Nov 5, 2018
@matsko matsko force-pushed the animate_pipe branch 2 times, most recently from 80c3b59 to 1533bc2 Compare November 6, 2018 09:20
@mary-poppins
Copy link

You can preview 1533bc2 at https://pr26931-1533bc2.ngbuilds.io/.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels Nov 6, 2018
@mary-poppins
Copy link

You can preview 6a548fe at https://pr26931-6a548fe.ngbuilds.io/.

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Nov 7, 2018
@matsko matsko force-pushed the animate_pipe branch 5 times, most recently from 98032a6 to a6789ad Compare November 11, 2018 15:51
@mary-poppins
Copy link

You can preview a6789ad at https://pr26931-a6789ad.ngbuilds.io/.

@matsko matsko force-pushed the animate_pipe branch 2 times, most recently from 6f83273 to 30d7ce1 Compare November 11, 2018 18:30
@mary-poppins
Copy link

You can preview dd02c54 at https://pr26931-dd02c54.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 13fe0dc at https://pr26931-13fe0dc.ngbuilds.io/.

@mary-poppins
Copy link

You can preview df73dbf at https://pr26931-df73dbf.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 8fdff6c at https://pr26931-8fdff6c.ngbuilds.io/.

@matsko matsko force-pushed the animate_pipe branch 2 times, most recently from 1d1e08d to 67ce48f Compare December 5, 2018 22:01
@mary-poppins
Copy link

You can preview 1d1e08d at https://pr26931-1d1e08d.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 67ce48f at https://pr26931-67ce48f.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 8f0c799 at https://pr26931-8f0c799.ngbuilds.io/.

@mary-poppins
Copy link

You can preview f1d1d6b at https://pr26931-f1d1d6b.ngbuilds.io/.

@mary-poppins
Copy link

You can preview bbe62d3 at https://pr26931-bbe62d3.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 6826828 at https://pr26931-6826828.ngbuilds.io/.

@mary-poppins
Copy link

You can preview d684d5d at https://pr26931-d684d5d.ngbuilds.io/.

@matsko matsko mentioned this pull request Jan 10, 2019
@mohammedzamakhan
Copy link

@matsko I was excited about animate pipe, but don't see it landing in labs too :(

@matsko matsko closed this Jul 19, 2019
@matsko matsko deleted the animate_pipe branch July 19, 2019 17:44
@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 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.

8 participants