data icon indicating copy to clipboard operation
data copied to clipboard

feat: register the future

Open runspired opened this issue 3 years ago • 2 comments

This PR implements the registry approach we've outlined in past team discussions. This approach so far has turned out to be achievable though with caution. It is extremely easy to accidentally find yourself in what I can only describe as subtype hell.

I don't recommend trying to change the pattern from what I've established here very much, I've had to find patterns that work effectively without hitting various edge cases that typescript is not yet prepared to handle for generics.

I'm not looking to type 100% of data to ship this, but it is a big enough thread-pull that roughly speaking that's what is happening. We'll ship as soon as we get this to "green" and iterate from there.

Unanswered Questions

  • ~~How should async relationships be typed?~~
  • ~~(depends on prior Q) should we (can we even?) look up inverse types for relationships from the registry.~~
  • What patterns should we publicly surface for typing async belongsTo relationship sets?
  • Is it better for module-level constants to use the default registry or be typed with unknown/object/string etc. instead? Either way any interaction with a module-level constant requires casting, but default registry might help the end-consumer story for importable utils like recordIdentifierFor,

runspired avatar Apr 18 '22 06:04 runspired

Asset Size Report for 7321fe31cf287f9f7ba266a6da20791f34570086

Modern Builds

☑️ EmberData has not changed in size

If any packages had changed sizes they would be listed here.

Changeset



Full Asset Analysis (Modern)

Asset Size Report
=================


Library: EmberData
┌────────────┬──────────┐
│  (index)   │  Values  │
├────────────┼──────────┤
│   bytes    │ '0.00 B' │
│ compressed │ '1.00 B' │
│  packages  │    0     │
│  modules   │    0     │
└────────────┴──────────┘

Modern Builds (No Rollup)

☑️ EmberData has not changed in size

If any packages had changed sizes they would be listed here.

Changeset



Full Asset Analysis (Modern)

Asset Size Report
=================


Library: EmberData
┌────────────┬──────────┐
│  (index)   │  Values  │
├────────────┼──────────┤
│   bytes    │ '0.00 B' │
│ compressed │ '1.00 B' │
│  packages  │    0     │
│  modules   │    0     │
└────────────┴──────────┘

github-actions[bot] avatar Apr 18 '22 06:04 github-actions[bot]

Performance Report for b6b708b8292c5d0258747f78119acd9606749363

Scenario - materialization: ☑️ Performance is stable

☑️ duration phase no difference [-18ms to 68ms] ☑️ Phase [navigationStart] => [start-find-all] phase no difference [-15ms to 16ms] ☑️ Phase [start-find-all] => [start-materialization] phase no difference [-7ms to 37ms] ☑️ Phase [start-materialization] => [end-materialization] phase no difference [-10ms to 21ms] ☑️ Phase [end-materialization] => [Test End] phase no difference [-4ms to 11ms]

Scenario - unload: ☑️ Performance is stable

☑️ duration phase no difference [-19ms to 66ms] ☑️ Phase [navigationStart] => [start-push-payload] phase no difference [-13ms to 27ms] ☑️ Phase [start-push-payload] => [start-unload-records] phase no difference [-7ms to 40ms] ☑️ Phase [start-unload-records] => [end-unload-records] phase no difference [-8ms to 13ms] ☑️ Phase [end-unload-records] => [Test End] phase no difference [-3ms to 2ms]

Scenario - destroy: ⚠️ Performance regressed

⚠️ duration phase estimated regression +53ms [6ms to 100ms] OR +1.47% [0.16% to 2.79%] ☑️ Phase [navigationStart] => [start-push-payload] phase no difference [-1ms to 40ms] ☑️ Phase [start-push-payload] => [start-destroy-records] phase no difference [-8ms to 45ms] ☑️ Phase [start-destroy-records] => [end-destroy-records] phase no difference [-2ms to 33ms] ☑️ Phase [end-destroy-records] => [Test End] phase no difference [-2ms to 3ms]

Scenario - add-children: ☑️ Performance is stable

☑️ duration phase no difference [-57ms to 14ms] ☑️ Phase [navigationStart] => [start-push-initial-payload] phase no difference [-38ms to 1ms] ☑️ Phase [start-push-initial-payload] => [start-push-update-payload] phase no difference [-20ms to 10ms] ☑️ Phase [start-push-update-payload] => [end-push-update-payload] phase no difference [-5ms to 5ms] ☑️ Phase [end-push-update-payload] => [Test End] phase no difference [-5ms to 3ms]

Scenario - unused-relationships: ☑️ Performance is stable

☑️ duration phase no difference [-38ms to 61ms] ☑️ Phase [navigationStart] => [start-push-payload] phase no difference [-21ms to 20ms] ☑️ Phase [start-push-payload] => [end-push-payload] phase no difference [-24ms to 47ms] ☑️ Phase [end-push-payload] => [Test End] phase no difference [-7ms to 2ms]

github-actions[bot] avatar Apr 21 '22 01:04 github-actions[bot]

after further time, exploration and discussion we are not going to pursue the registry approach.

runspired avatar Feb 25 '24 04:02 runspired