sindresorhus / sindresorhus/Defaults

Support external storage option?

Open
#150 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.5k
Forks
163
PR merge metrics
No merged PRs in 30d

Description

Sometimes you need to store something that is a bit larger, like a icon image. Storing this in UserDefaults would be slow as it has to be decoded each time it's accessed.

SwiftData has a .externalStorage option that makes it store it to a file on disk instead of in the database. Maybe we could do something similar.

static let icon = Key<NSImage?>("icon", externalStorage: true)

This can only be supported if the suite option is not given as otherwise we don't know where to store it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the linked SwiftData externalStorage behavior and determine how external data should be located when no suite is provided. Define the supported API and storage behavior, then verify that suite-based defaults remain unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.