fix(grid,tree-shake): use lightweight token for paginator #13896
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a DI alias for the paginator using a lightweight token and swapped the content queries in the grids to use it instead so the component can be tree-shaken when not in use.
Note, it's not a "by-the-book" lightweight token implementation since the
IgxPaginatorComponent
still extendsDisplayDensityBase
and I didn't want to mix that with the token. Instead, left a comment since the density is deprecated and will be dropped eventually. Also, thepaginator
prop on the grids is still part of the public interface (even as hidden) and I left that with just type imports to avoid propagating the change further and will leave that again for later once the public interface is cleaned up.Results:
![image](https://private-user-images.githubusercontent.com/3198469/304108813-efe8ebca-2fe1-4c05-a7c6-0b03977cc6d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5OTY0NTQsIm5iZiI6MTczOTk5NjE1NCwicGF0aCI6Ii8zMTk4NDY5LzMwNDEwODgxMy1lZmU4ZWJjYS0yZmUxLTRjMDUtYTdjNi0wYjAzOTc3Y2M2ZDUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTlUMjAxNTU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDkzNWU4ZjU4YzJiYTc4NDk1ODMyZTdlYjU3MGE1OTkzNWE5OTdhZmRmOTEyMmE4YjU0MjE2Mzk5YTVhZGVhYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.rIA0xsTcbYtHFN1ttGvHFEmMsE2bDQDTcqgPuAZMNhM)
Given the app imports just
IgxGridComponent, IgxColumnComponent
before and after:Small win, but the correct approach for this type of child component relations nonetheless :)
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes (migrations guidelines)