-
-
Notifications
You must be signed in to change notification settings - Fork 410
A new reactive primitive: cell
#1071
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
Open
NullVoxPopuli
wants to merge
22
commits into
main
Choose a base branch
from
the-cell
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+668
−0
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4eb7776
The Cell
NullVoxPopuli c0b20b6
Update meta
NullVoxPopuli 7b9e4b7
The Cell
NullVoxPopuli 21cef4c
The Cell
NullVoxPopuli 3aee4a2
Update text/1071-cell.md
NullVoxPopuli 0d7b5e1
Update from todos
NullVoxPopuli 99e40db
Apply performance feedback around class instantiation, reducing alloc…
NullVoxPopuli 40744af
Update 1071-cell.md
NullVoxPopuli ec260e2
Update Cell to mention that it supercedes tracked storage
NullVoxPopuli 54f5d89
Clarify that only 'cell' is exported as a value
NullVoxPopuli 9f32bac
Update 1071-cell.md
NullVoxPopuli 9de5ab1
Update 1071-cell.md
NullVoxPopuli 5004f23
Remove constructor from the public interface
NullVoxPopuli a6acfb5
Remove boilerplate
NullVoxPopuli e7170cc
Add explicit examples
NullVoxPopuli 6968d73
Update 1071-cell.md
NullVoxPopuli 300cfd8
Remove .read()
NullVoxPopuli 97619f9
Cover naming
NullVoxPopuli 8a758f1
updates
NullVoxPopuli c7786b6
updates
NullVoxPopuli de0b419
Example
NullVoxPopuli 5d89900
Mention formula's in a footnote
NullVoxPopuli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
should we support
lazyvalues?For example, if initial value is a tricky logic, there is no reason to resolve it during cell creation, because it may be used later.
(case for decorators too, where initializer is a may be reactive value, and we may be "looped")
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.
What would the implementation of createLazy potentially look like?
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.
Like this: https://github.com/lifeart/glimmer-next/blob/master/src/utils/reactive.ts#L142 it's not 100% accurate, but main idea is same
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.
Don't dynamically created/modified objects create extra memory pressure?
Uh oh!
There was an error while loading. Please reload this page.
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.
@NullVoxPopuli it is, but it depends on usecase, in browser we limited by CPU, not by memory :)
also, it may be a case where we create value, but it's not used (set is called before get) and in this case we saving alot
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 don't see why it couldn't be added later as well
It may make more sense to do lazy construction in objects/arrays/maps, etc?