Skip to content

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Apr 6, 2018

No description provided.

@matsko matsko requested a review from mhevery April 6, 2018 20:41
@mary-poppins
Copy link

You can preview 749ed3f at https://pr23232-749ed3f.ngbuilds.io/.

@matsko matsko added the target: major This PR is targeted for the next major release label Apr 6, 2018
Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

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

one small nit, LGTM otherwise

import {MockDirectory, setup} from '../aot/test_util';
import {compile, expectEmit} from './mock_compile';

/* These tests are codified version of the tests in compiler_canonical_spec.ts. Every
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this comment as it is not relevant

Copy link
Contributor

Choose a reason for hiding this comment

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

?

convertedBinding);
continue;
}

const instruction = BINDING_INSTRUCTION_MAP[input.type];
Copy link
Contributor

@vicb vicb Apr 6, 2018

Choose a reason for hiding this comment

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

why not const instruction = getInputInstruction(input); ?

(or something similar as the number of args is different, the idea being to centralize the computation of the instruction)

actually something like

// class & style
const specialInstruction = SPECIAL_BINDING_INSTRUCTION_MAP[input.name];
if (specialInstruction) {
        this.instruction(
            this._bindingMode, input.sourceSpan, specialInstruction, o.literal(elementIndex),
            convertedBinding);
        continue;
}

const instruction = ...;
// ...

Choose a reason for hiding this comment

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

hehe

$r3$.ɵE(0, 'div');
$r3$.ɵe();
}
$r3$.ɵs(0,ctx.myStyleExp);
Copy link
Contributor

Choose a reason for hiding this comment

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

ctx should probably not be hardcoded -> use $ctx$ instead ? (in the arg list and here)

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

see inline comments

@matsko matsko force-pushed the ivy_style_property branch from 749ed3f to 5e61db0 Compare April 7, 2018 22:52
@matsko matsko changed the title Special case [style] and [class] bindings fix(ivy): special case [style] and [class] bindings for future use Apr 7, 2018
@matsko matsko force-pushed the ivy_style_property branch 2 times, most recently from 5c4fc09 to 3c1d545 Compare April 7, 2018 22:55
@mary-poppins
Copy link

You can preview 5e61db0 at https://pr23232-5e61db0.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 5c4fc09 at https://pr23232-5c4fc09.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 3c1d545 at https://pr23232-3c1d545.ngbuilds.io/.

$r3$.ɵE(0, 'div');
$r3$.ɵe();
}
$r3$.ɵs(0,$ctx$.myStyleExp);

Choose a reason for hiding this comment

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

space after comma?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it's not needed because this code is generated by AOT (and it conserves size by avoiding unnecessary space usage).

Copy link
Contributor

Choose a reason for hiding this comment

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

this is a test, and spaces are ignored so for readability you should add it.

$r3$.ɵE(0, 'div');
$r3$.ɵe();
}
$r3$.ɵk(0,$ctx$.myClassExp);

Choose a reason for hiding this comment

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

space after comma?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See comment above.

Copy link
Contributor

Choose a reason for hiding this comment

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

see my comment above. please add space to make it more readable. This is test only and will not have effect on output of compiler.

@@ -267,6 +267,11 @@ const BINDING_INSTRUCTION_MAP: {[index: number]: o.ExternalReference | undefined
[PropertyBindingType.Style]: R3.elementStyleNamed
};

const SPECIAL_CASED_BINDING_INSTRUCTION_MAP: {[index: string]: o.ExternalReference | undefined} = {
Copy link
Contributor

Choose a reason for hiding this comment

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

| undefined ?

@matsko matsko force-pushed the ivy_style_property branch from 3c1d545 to 29d4466 Compare April 12, 2018 18:46
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

inline comments

@@ -273,6 +273,11 @@ const BINDING_INSTRUCTION_MAP: {[index: number]: o.ExternalReference | undefined
[PropertyBindingType.Style]: R3.elementStyleNamed
};

const SPECIAL_CASED_BINDING_INSTRUCTION_MAP: {[index: string]: o.ExternalReference} = {
'className': R3.elementClass,
Copy link
Contributor

Choose a reason for hiding this comment

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

class ?

import {MockDirectory, setup} from '../aot/test_util';
import {compile, expectEmit} from './mock_compile';

/* These tests are codified version of the tests in compiler_canonical_spec.ts. Every
Copy link
Contributor

Choose a reason for hiding this comment

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

?

@matsko matsko force-pushed the ivy_style_property branch from 29d4466 to 80feb9d Compare April 12, 2018 18:58
@mary-poppins
Copy link

You can preview 29d4466 at https://pr23232-29d4466.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 80feb9d at https://pr23232-80feb9d.ngbuilds.io/.

@ngbot
Copy link

ngbot bot commented Apr 23, 2018

Hi @matsko! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@matsko matsko force-pushed the ivy_style_property branch from 80feb9d to e1d89d9 Compare June 1, 2018 16:38
@mary-poppins
Copy link

You can preview e1d89d9 at https://pr23232-e1d89d9.ngbuilds.io/.

@matsko matsko force-pushed the ivy_style_property branch from e1d89d9 to f0ca8b9 Compare June 1, 2018 23:30
@mary-poppins
Copy link

You can preview f0ca8b9 at https://pr23232-f0ca8b9.ngbuilds.io/.

$r3$.ɵe();
}
if (rf & 2) {
$r3$.ɵs(0,$r3$.ɵb($ctx$.myClassExp));
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be ɵk?

@matsko matsko force-pushed the ivy_style_property branch from 428f29d to 9e7e278 Compare June 5, 2018 18:43
@mary-poppins
Copy link

You can preview 9e7e278 at https://pr23232-9e7e278.ngbuilds.io/.

@matsko matsko added the action: merge The PR is ready for merge by the caretaker label Jun 6, 2018
@ngbot
Copy link

ngbot bot commented Jun 6, 2018

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure missing required status "code-review/pullapprove"
    pending status "google3" is pending

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@matsko matsko requested review from mhevery and removed request for mhevery June 6, 2018 20:30
vicb
vicb previously requested changes Jun 6, 2018
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

please update status.md

@vicb vicb added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jun 7, 2018
@matsko matsko force-pushed the ivy_style_property branch from 9e7e278 to e284c46 Compare June 7, 2018 18:24
@mary-poppins
Copy link

You can preview e284c46 at https://pr23232-e284c46.ngbuilds.io/.

@mhevery mhevery dismissed vicb’s stale review June 7, 2018 21:01

I have updated the STATUS.md

@mhevery
Copy link
Contributor

mhevery commented Jun 7, 2018

STATUS.md updated

@mhevery mhevery removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jun 7, 2018
@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 the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels Jun 7, 2018
@mhevery mhevery added cla: yes and removed cla: no labels Jun 7, 2018
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

@mary-poppins
Copy link

You can preview 292f37d at https://pr23232-292f37d.ngbuilds.io/.

@@ -25,8 +25,12 @@ export class Identifiers {

static elementAttribute: o.ExternalReference = {name: 'ɵa', moduleName: CORE};

static elementClass: o.ExternalReference = {name: 'ɵk', moduleName: CORE};
Copy link
Contributor

@vicb vicb Jun 8, 2018

Choose a reason for hiding this comment

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

Could you please update environment.ts with that.

Also may be add a comment in this file and environment.ts to remember to keep them in sync.

Thanks

Edit: The instructions are actually already there.

@mhevery mhevery closed this in 1b253e1 Jun 8, 2018
@matsko matsko deleted the ivy_style_property branch January 17, 2019 19: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 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker 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.

9 participants