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

refactor(argument): Update to use @argument #479

Merged
merged 1 commit into from
Jan 24, 2018

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Jan 18, 2018

Refactors to use @argument, @type, and other new decorators. Cleans up some unused code as well, and in general straightens things out (declaring all arguments, removing unused ones, etc.)

cc @twokul @cyril-sf @billy-addepar

// We have to alias because the class name changes per base cell type
@className('', 'et-td')
@readOnly @alias('isFixed') _isFixed;

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: remove this blank line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Think you could handle this? Don’t have my computer right now 😅


// We have to alias because the class name changes per base cell type
@className('', 'et-td')
@readOnly @alias('isFixed') _isFixed;
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not quite sure how the _isFixed works here? It's not read anywhere. Can you explain more here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@className binds the property to a class name, and we provide those class names and the arguments. We can do it directly to isFixed because of problems with how it works in ember-decorators, so we need to make an alias.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to open up a bug report in ember-decorators, but this would be a breaking change so we’ll need to hold off for some time.


export default class CellProxy extends EmberObject {
@property column = null;
column = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to put @argument decorator for this? This is a required field for cell proxy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@argument is meant for components, its dynamics don’t work really well here yet. We can update in the future, but it’s tricky so I kept it simple.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could just use @type here potentially.

@billy-addepar
Copy link
Contributor

Looks good overall. Just a few comment & question

@billy-addepar
Copy link
Contributor

hmm, I got Assertion Failed: arr must be an instance of a Javascript Array or implement "objectAt" when running this branch. Do you have that issue @pzuraq ?

@pzuraq
Copy link
Contributor Author

pzuraq commented Jan 18, 2018

Do you mean in Iverson? If so, that means we have a lack of test coverage here.

@billy-addepar
Copy link
Contributor

billy-addepar commented Jan 18, 2018

No, even with this repo. The demo app fails to load

@pzuraq pzuraq force-pushed the pzuraq/refactor/upgrade-decorators branch from 425a738 to 47b2e5c Compare January 23, 2018 02:08
Refactors to use @argument, @type, and other new decorators. Cleans up
some unused code as well.
@pzuraq pzuraq force-pushed the pzuraq/refactor/upgrade-decorators branch from 52a83d2 to b8e5c87 Compare January 24, 2018 02:04
@pzuraq pzuraq merged commit 93e1ad0 into master Jan 24, 2018
@pzuraq pzuraq deleted the pzuraq/refactor/upgrade-decorators branch January 24, 2018 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants