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

Fix dxi component template rerendering issues #560

Merged
merged 8 commits into from
Sep 28, 2017
Merged

Conversation

dxbykov
Copy link
Contributor

@dxbykov dxbykov commented Sep 20, 2017

No description provided.

import { DxTemplateDirective } from './template';

export interface IDxTemplateHost {
Copy link
Contributor

@kvet kvet Sep 21, 2017

Choose a reason for hiding this comment

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

We don't use I prefix for interfaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

5 of 7 existing interfaces have I prefix and just 2 don't. I would add it to the rest two.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are good points why we should use the I prefix :)

README.md Outdated
@@ -457,6 +457,28 @@ export class AppComponent {
}
```

Note, in some scenarios an item content can be rerendered by it's host component. To keep the item child components alive they should be declared as a single template via the `dxTemplate` structural directive. There are several alternatives depending on the item content:
Copy link
Contributor

@kvet kvet Sep 21, 2017

Choose a reason for hiding this comment

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

How can I find out is my scenario suited a described one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. One way is if something works unexpectedly. Would you deprecate the approach without using dxTemplate in dxi-* components? Or any other thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

So, the workflow:

  • write code
  • check that it works correctly in all cases (if it embedded in another component and so on)
  • if something went wrong - add dxTemplate and check again

It's a weird solution. It will be better to mark dxi- components without dxTemplate as deprecated and buggy in order to suppress support traffic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It appears that simple transclusion is much faster than using templates. So I'm afraid we shouldn't deprecate this approach. A clear condition for using templates is "you item content has any nested components (not just static markup)".

@dxbykov dxbykov merged commit e74ac41 into master Sep 28, 2017
@dxbykov dxbykov deleted the templated-dxi-item branch September 28, 2017 17:09
@Aden-git Aden-git modified the milestones: 17.1.7, 17.2.1 Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants