-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat(template): introduce rxChunk #1380
base: main
Are you sure you want to change the base?
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit b3c6d22. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hoebbelsB really like the idea. Looks super interesting!
* @param {NextObserver<void>} renderCallback | ||
*/ | ||
@Input('rxChunkRenderCallback') | ||
set renderCallback(renderCallback: NextObserver<void>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use not only subjects but also just a function? I know it's more like a general question for render callbacks but would it worth the try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, I would even more like to just have an @Output
. But it looks like it's not supported, at least for the *
syntax. angular/angular#12121
* | ||
* @param { RxStrategyNames<string> } strategy | ||
*/ | ||
@Input('rxChunk') strategy = this.strategyProvider.primaryStrategy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it planned to work with not concurrent strategies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, but why would u? it basically makes the rxChunk
do nothing useful anymore :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the thing. Can we type this input to RxConcurrentStrategyNames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to support all Strategien. Other strategies then concurrent will have an effect definitely. U could e.g. use 'noop' strategy when out of viewport
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a need to support all strategies. If you want to change the rendering strategy conditionally, then this is necessary.
And it makes sense in many cases to switch the strategies based on conditions like first render and other things which may affect CLS
@hoebbelsB shouldn't we wait for the first stable release before introducing new elements? |
As not all strategies chunk let's call it rxTemplate? |
Codecov Report
@@ Coverage Diff @@
## main #1380 +/- ##
===========================================
+ Coverage 74.95% 85.14% +10.19%
===========================================
Files 151 20 -131
Lines 2951 404 -2547
Branches 531 56 -475
===========================================
- Hits 2212 344 -1868
+ Misses 617 34 -583
+ Partials 122 26 -96
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hi, the current workaround for this is to do *rxLet="[]" Which from anyone who is not aware of the pattern makes 0 sense. Is there anything blocking the issue? Is it only the name that's blocking?
|
ChunkDirective
This PR introduces the
*rxChunk
structural directive.the
*rxChunk
directive serves as a convenient way for dividing template work into chunks.Applied to an element, it will schedule a task with the given RxRenderStrategy in order to postpone the template creation of this element.
PR Checklist
Features of
*rxChunk
*rxLet="[]"