-
Notifications
You must be signed in to change notification settings - Fork 15
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
Glimmer components migration #344
Comments
Nested "pod" glimmer components work if you name them index.js and index.hbs inside the folder with the component name. But I think naming both files as component-name.js and component-name.hbs is more standard and I don't see why we shouldn't do it that way. |
Yes it did work nested when I renamed the template to component.hbs, which is basically the same as renaming them both to index.xxx they just have to have the same name where ever it is. K, so for example, the body component will not be in the body dir anymore but up one dir and named body.xxx, but will still be nested in the yeti-table dir. You can either close this issue or leave it open to track converting the comps to glimmer. I would like to convert them a couple at a time starting at the lower comps rather than do a massive PR. |
I cant find it listed anyway, what is the earliest version that yeti-table supports? Ember-try starts at 3.16, is that it? or should there be some additional trys added for the earlier versions? |
Not sure also how to allow documenting but like the following code is no longer valid under glimmer as the onRowClick will be no longer on the backing store but referred to as this.args.onRowClick. If I delete the below code will that effect the documentation at all?
Also the linter says not to create empty backing classes (we can ignore of course) but that means addon docs doesnt have a place to get docs from code. Hmmm, |
@bgantzler I think it is possible to keep the jsdoc comment without an actual variable declared, but you need to add the |
What version of ember do you plan on supporting back to? Looking at updating some of the syntax and removing unneeded polyfills |
@bgantzler I would be ok with officially supporting whatever versions latest ember-try tests cover. Additionally, we could try adding some scenarios for older versions and see how far can we go without breaking. |
Current dependencies are "@ember/render-modifiers": "^1.0.2", 2.18+ So..... 3.4 is the farthest possible because of dependancies. that means we can get rid of most the get(this, "prop") syntac in favor of this.prop. I say most because any access to user supplied data will still need to use get as ember data uses proxies Ill add some tries for 3.4 + |
Ok so they way the files were named originally did compile under 3.12, but the way they are named now (which Im pretty sure is the glimmer way of doing things) will NOT compile under 3.12. get the following
So since ember try was only running 3.16 and later didnt notice. Since you said you were fine with officially supporting what ember-try scenarios were in place (3.16+), Im am going to go with that. @miguelcobain Please confirm or reject as soon as you can as I will be removing some of the polyfills that are no longer needed |
@sly7-7 Once the the above PR is merged, I will resubmit the PR for Body, TBody, Tbody/row and cell, I was then going to do TFoot/row/cell set and pagination. If you want to do those as a PR ill move onto the header set. |
@cah-briangantzler I can at least try to make this PR concerning TFoot/row/cell. I think I must wait for #352 before beginning. |
If you mean the code is the same, actually some of it should not be, the if for prop https://github.com/miguelcobain/ember-yeti-table/blob/master/addon/components/yeti-table/tbody/row.js#L60 should ONLY be in the Thead column registration, prop is never passed on body or foot cell, prop is derived from column which is what the else is looking up, so Im removing that in body/row and it should also be removed in foot/row. That does leave them looking the same, but I would leave them as separate functions to allow them each to do special processing should the need arise. There isnt now, but could be later. I dont think you have to wait for #352. Up to you. I already have the body/row/cell coded, after that PR is merged I will rebase my branch. What ever you feel comfortable with. In the one PR you had offered to help, so trying to make sure you have the opportunity. |
Thanks for the feedback. So I'm doing tfoot/row/cell right now. |
So down to three components left, yeti-table, column, pagination. These will take a little longer due to the complexity. Wont see some PRs quite as quickly as the other ones :) |
@cah-briangantzler what's your strategy for observing changes to the given Will auto-tracking get us covered without doing much? Maybe that's the case and user's are the ones responsible for setting up Almost all of the complexity on the main component comes from creating dynamic computed properties. Not sure how this will port to glimmer components yet. So, because auto-tracking is based on access and not on declaring the dependencies, it might just work™ by defining normal getters. |
If they create objects as @Tracked were covered, Ember Data is auto tracked, I think the question here is how to support an array of POJOs and the answer is we still create the computed properties or we use something like https://github.com/pzuraq/tracked-built-ins which does not support IE 11 (Proxies). Would that be a problem? If we dont create the computeds and depend on the user doing @Tracked, thats a pretty big breaking change. You can still convert an object to glimmer and use computeds, @Tracked is just a sub feature provided by glimmer. the glimmer complexity I have to work through is more the one-way bound, this.args, and providing a default value for optional passed params. |
I think the new "mental model" that octane is pushing forward is to start thinking about annotating the data source and forgetting.
I do agree that it would be a breaking change, but I'm more concerned about what is the correct approach and no so much about breaking changes since we're major bumping. If you make a table component yourself in your own octane codebase and pass it some array of POJOs, things won't automatically update either. This topic is still a bit unclear to me. |
Agree with all that. The breaking change would be either user the I would prefer to create the computeds, in this release so people could upgrade fairly seamlessly, then deprecate the creation of the computeds and remove them later, giving people a longer runway to prepare. Im not sure I would be able to upgrade yeti-table for a while if we did away with the computeds. I cant use the Specifically why I am saving that to the last thing to convert and getting the easy stuff out of the way. |
If you don't know if you can upgrade yet, you could always stay on a previous version (we can still backport bugfixes and maybe even some small features). You would still benefit from the components just being glimmer components, since they're quite faster. So, I can see your point of a semi-octane release making sense. What about some hybrid way? Perhaps only creating those computed properties based on some flag? Another option would be to release 2.0 ("semi octane") and the 3.0 (octane) right after? People like you could stay on 2.0. Sorry for the random written thoughts, but I'm trying to make sure we're not missing anything. |
I had already planned on a flag that created the computeds, if the flag was off, no computeds. That way we could actually issue a deprecation. The deprecation would be the flag is on, creating the computeds and this would be removed in the next major release. This is all theory though as I havent converted it yet and who knows, may come up with a clever idea when we get to that point. |
Waiting on approval of #376 Working on yeti proper and finding that in your test you do I can update the test, but just wondering if anyone is actually do this. They will need to change to either an actual method that updates the value or This is an actual change required by glimmer, not something we are actually doing in this repo. |
I am using
I use this |
It appears that the fn version reads the value in addition to changing it, where the action version does not. Not sure why. But reading the value first is what throws the warning that you accessed a value during the same render as changing it. Just wanted to make sure it was noted somewhere |
@cah-briangantzler as you said, this is something that isn't directly related with ember-yeti-table, so we should just fix it in some way here. |
What is the intent of the test Is this a test I need to honor or can this test be removed? |
This is used only in our tests, and I did fix the tests. I just wanted to mention it so if anyone in their code was using the |
@cah-briangantzler The purpose of that test is to improve interoperability with inputs. Basically, to facilitate situations like the following: <Input @value={{this.filterText}}/>
<YetiTable @loadData={{this.loadData}} @filter={{this.filterText}} as |table|>
{{!-- ... --}} In this case, There is some code to equate Basically, we default the Let me know if this answered your question. |
Ok so setting the default of '' should handle most of it, but setting @dedupeTracked with handle the rest. filter was the only prop that had this test, but I also assume that means things like sort, pageNumber, etc should also use @dedupeTracked as well. |
Well, I guess it wouldn't "hurt", but |
Interesting. You can not combine @localcopy with @dedupeTracked
Either we let loadData be called twice or I have to use my version of the code instead of @localcopy. Basically you cant dedupe an this.args property, which kinda makes sense. |
I would also purpose to do away with many of the defaults in code and just add them to the default theme. For example filter, if it was added to the default config as "", you wouldnt need to worry about the defaulting in code as it would be handled the same way as all the other user supplied defaults |
@cah-briangantzler I guess we need to find a way add some "gate" somewhere and only allows changes when the values are different. |
Right now the filter property is used on an ember computed. Are you migrating that to a native getter? |
Scratch that. There is a variation of @localcopy I should be using. Will let you know how it goes |
Its a little bit of reading, but I think the answer is in here. |
|
It seems that there are some issues with glimmer, co-location, and the current structure that are incompatible. There was an old issue since fixed, ember-cli/ember-cli-htmlbars#265, but I think this repo has a nuance that wasnt fixed. Im not sure if its worth reporting or just altering this repo. (Spend a couple hours trying to figure out why things didnt work when converting to glimmer)
The nuance seems to be it is using pods syntax without actually saying it's using PODS (even though it works) and possibly that the components are nested in sub directories. (The super rentals demo shows glimmer working with pods, but it declares PODS and the components are not nested)
I experimented with converting the body component and it doesnt render unless we do one of the following. Rename template.hbs to component.hbs, or move both files up one directory and rename as body.js and body.hbs. I think the moving of the files and naming appropriately is the way to go. Is that ok with you?
The text was updated successfully, but these errors were encountered: