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.
This PR illustrates how we could do most of the app logic without IDs. It's not for review, but as a study.
I'm effectively using the account and server objects as the "ids". You can do lookups by scanning and doing equality comparisons, but not indexed lookups.
Scanning instead if indexing can be a performance issue, but in practice it doesn't matter in this case. However I still ran into 2 major issues:
getServerView
expects an IDLAST_DISPLAYED_SERVER_STORAGE_KEY
It's possible to work around # 1 by either scanning the DOM tree, or by properly doing attribute binding with the serverList. Instead of looking up the server view, we should be setting the properties on the serverList instead.
Issue # 2 requires a persistent ID that survives restarts, so we can't use the objects as identity. Therefore we can't get away from using stable IDs. We could use random ids for the objects, like we do in the client, but that would require persisting the random ids. Instead, we can compose persistent IDs without persisting them by combining the account uuid and the droplet id, as I do on #852.