Giter Site home page Giter Site logo

Comments (13)

GavinJoyce avatar GavinJoyce commented on September 25, 2024

This happens for me with a single {{#each}} too:

import Component from "@glimmer/component";

export default class MyApp extends Component {
  speakers = ['Tom', 'Yehuda', 'Ed'];
}
<ul>
  {{#each speakers key="@index" as |speaker|}}
    <li>{{speaker}}</li>
  {{/each}}
</ul>
"@glimmer/application": "^0.4.0",
"@glimmer/application-pipeline": "^0.5.2",
"@glimmer/component": "^0.3.8",
"@glimmer/resolver": "^0.3.0",

from glimmer-application.

GavinJoyce avatar GavinJoyce commented on September 25, 2024

It seems that component.args = bucket.namedArgsSnapshot(); results in a propertyDidChange for args, which then causes a subsequent rerender. args are tracked here.

from glimmer-application.

GavinJoyce avatar GavinJoyce commented on September 25, 2024

Related, we seem to rerender twice at boot time for an app with static content:

{{!-- template.hbs --}}
<div>
  hello
</div>

from glimmer-application.

locks avatar locks commented on September 25, 2024

@chadhietala I believe you were looking into some of this?

from glimmer-application.

chadhietala avatar chadhietala commented on September 25, 2024

@tomdale this is what I was talking about. We need to check the global revision before we schedule a re-render.

from glimmer-application.

tomdale avatar tomdale commented on September 25, 2024

@chadhietala Nope. Args is a watched property, so setting it is causing it to rerender. It also means the current revision is getting bumped. As we talked about. 😉

from glimmer-application.

tomdale avatar tomdale commented on September 25, 2024

This is a weird case because we want args to invalidate other tracked properties, but not schedule a rerender.

from glimmer-application.

CvX avatar CvX commented on September 25, 2024

@tomdale Is there anything that has to be done beyond removing args tracking?
I did that and added a test for the rerender loop (CvX/glimmer-component@13456a9).
All tests pass, but maybe there are some other args-related functionalities that were never tested?
I'd really like to squash this bug. 😃

from glimmer-application.

balinterdi avatar balinterdi commented on September 25, 2024

@tomdale To clarify, we currently have to do @tracked('args') as we cannot track individual attributes, like @tracked('args.rating'), right? (I tried that and it didn't work but perhaps I was missing something?)

from glimmer-application.

CvX avatar CvX commented on September 25, 2024

@balinterdi You're completely right, forgot about that use case.
Updated the test and added dirtying the args tag. CvX/glimmer-component@a8aaa2b

from glimmer-application.

balinterdi avatar balinterdi commented on September 25, 2024

@CvX Does it work now? It's still a workaround, though, isn't it? (And we should be able to track individual properties.)

from glimmer-application.

CvX avatar CvX commented on September 25, 2024

@balinterdi it does its job, but whether it should land on master in this form is a question for someone with more (ie. any 😁) experience with glimmer code.

Don't know what's the plan for tracking individual properties.

from glimmer-application.

locks avatar locks commented on September 25, 2024

This repo has been merged with glimmerjs/glimmer.js (into a monorepo setup). I am not sure if this issue is still applicable, but if you could confirm it is still an ongoing concern and open it over there that would be very helpful.

Sorry for the noise, but thank you for your help!

from glimmer-application.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.