-
Notifications
You must be signed in to change notification settings - Fork 51
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
Design discussion about build time AST transform functionality #14
Comments
There are two parts to this. For those properties that are part of the The second part is more complicated and where I'm still a bit stuck. The children of the |
I'm not sure I follow, but just for the sake of clarity, and to make sure we're not overlooking something, here's what I see happening in the DOM with the magic slider: When the slider is at 0, then magic=0, and thus there's no transform on the fontawesome icon object, and thus the elements rendered have the structure:
If the slider is non-zero, then that kicks in the transform attribute on the
And of course, some of the attributes on some of these elements are also changing as the slider slides. I can imagine that the AST transform could output a structure like either the former or the latter, and within those structures, bind some attributes that could allow it to be dynamic somehow. But it wouldn't know to output both structures, right? So I think that's an example of your "second part". However, in the case of the spinning magic (and anything like it), the structure changes depending on that bound value. And that's true not only where you have So I wonder if there's some way that the AST transform can either guarantee that it's not eliminating some intended dynamic behavior, or else warn if it can't guarantee that. And then I guess there'd need to be some documentation about when that AST transform optimization is valid, and when it's not. For example, if it sees that the component is binding to the Does it sound like I'm in the same neighborhood of thinking as you here? |
Yes, we're on the same page. We're only going to be able to transform some of the simplest permutations. In fact I wasn't aware of the nested |
When you get to outputting icons to see what they look like—if you find something that's a distinctly different class—I think it would help for us to get a representative example into the dummy app and/or test suite. That was part of what I had in mind when I made that dummy app template: acceptance criteria, if you will. But I did not do a systematic combing through all possibilities, so it's quite possible that there are others. In particular, the example with the mask and the example with the magic slider are two that I've visually inspected time and again throughout development as a way to make sure I'm not breaking something with my commits. @robmadole may know off the top of his head of any other classes of examples that we should exercise—he's the one who recommended that I try the "mask with transform" (square with the little off-center dot) and "dynamic transform" (sliding magic) cases. |
Opening a new issue here to carry forward design discussion about the AST transform functionality that @jrjohnson is porting from
ember-font-awesome
and mentioned in #8.So, @jrjohnson how might these build time AST transforms impact animated icon use cases, or any case where the
<svg>
DOM tree changes in response to something happening in the app?For example, with the "magic slider" example currently in the dummy app, the DOM tree under the
<svg>
changes structurally when you move that slider. So that seems like a case that couldn't be rendered statically at build time. Admittedly, most icons are probably static and could be rendered statically without any functional impact.The text was updated successfully, but these errors were encountered: