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

animation skips straight to final state on production build (when using booleans for state) #20374

Closed
fxck opened this issue Nov 12, 2017 · 5 comments
Labels
area: animations freq2: medium regression Indicates than the issue relates to something that worked in a previous version type: bug/fix

Comments

@fxck
Copy link

fxck commented Nov 12, 2017

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

It works fine on stackblitz https://stackblitz.com/edit/burger?file=app%2Fburger%2Fburger.component.ts as well as with ng serve --aot, but doesn't work when built with ng build --prod http://burger.fxck.cz/

Minimal reproduction of the problem with instructions

works (dev): https://stackblitz.com/edit/burger?file=app%2Fburger%2Fburger.component.ts
doesn't (prod): http://burger.fxck.cz

What is the motivation / use case for changing the behavior?

Environment


Angular version: 5.0.1


Browser:
All
 
For Tooling issues:
- Node version: all   
- Platform:   all

Others:

cc @matsko

@fxck
Copy link
Author

fxck commented Nov 13, 2017

@matsko I managed to pin it down I think.

The problem is certainly not with me using a function to return the trigger, nor with params being passed down by the function. In fact this simple animation:

  animations: [
    trigger('line', [
      state('true', style({
        width: '40px'
      })),
      state('false', style({
        width: '20px'
      })),
      transition('true <=> false', [
        animate('500ms')
      ])
    ])
  ]

is not going to work either, but this will

  animations: [
    trigger('line', [
      state('opened', style({
        width: '40px'
      })),
      state('closed', style({
        width: '20px'
      })),
      transition('opened <=> closed', [
        animate('500ms')
      ])
    ])
  ]

so the problem is obviously with using boolean, but curiously enough ONLY in production build, so something (likely the transition, since the final state is actually applied) is perhaps being removed while it shouldn't.

@fxck fxck changed the title animation skips straight to final state on production build animation skips straight to final state on production build (when using booleans) Nov 13, 2017
@fxck fxck changed the title animation skips straight to final state on production build (when using booleans) animation skips straight to final state on production build (when using booleans for state) Nov 13, 2017
@matsko matsko added freq2: medium regression Indicates than the issue relates to something that worked in a previous version type: bug/fix labels Nov 21, 2017
@matsko
Copy link
Contributor

matsko commented Nov 21, 2017

Looking into it... Thank you @fxck.

matsko added a commit to matsko/angular that referenced this issue Dec 1, 2017
…nstructor

For some reason, prior to this fix, the boolean set matching
code (within `animation_transition_expr.ts`) failed to remain
the same when compiled with closure. This refactor makes sure
that the code stays in tact.

Reproduction Details:
Passes without `ng build --prod`: https://burger.stackblitz.io/
Fails with `ng build --prod`: http://burger.fxck.cz/

Closes angular#20374
@matsko
Copy link
Contributor

matsko commented Dec 1, 2017

@fxck just letting you know that the issue was detected and #20725 fixes it.

@matsko
Copy link
Contributor

matsko commented Dec 1, 2017

Thank you for making this issue easy to debug.

jasonaden pushed a commit that referenced this issue Dec 8, 2017
…nstructor (#20725)

For some reason, prior to this fix, the boolean set matching
code (within `animation_transition_expr.ts`) failed to remain
the same when compiled with closure. This refactor makes sure
that the code stays in tact.

Reproduction Details:
Passes without `ng build --prod`: https://burger.stackblitz.io/
Fails with `ng build --prod`: http://burger.fxck.cz/

Closes #20374

PR Close #20725
@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 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: animations freq2: medium regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants