Skip to content
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

implement store portion of v2 cache #8114

Merged
merged 9 commits into from
Aug 11, 2022
Merged

implement store portion of v2 cache #8114

merged 9 commits into from
Aug 11, 2022

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Aug 10, 2022

Implements the Store / StoreWrapper portion of emberjs/rfcs#461

The Cache portion will come in a different PR as it's a complicated dance of feature flags, in particular to support ember-m3/ember-m3#1650

Release notes

  • introduces new deprecations for the older more verbose APIs for folks implementing a custom record-data. This should almost entirely be a non-user facing change as only a few addons have implemented RecordData's.
  • finally introduces public documentation for Store.createRecordDataFor, RecordDataStoreWrapper and the SchemaDefinitionService interface, all documented for the V2 version of these things. Documentation for the RecordData interface itself will be added once V2 is available.

@runspired runspired added 🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166 🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature 🏷️ deprecation 5.0 Roadmap labels Aug 10, 2022
@github-actions
Copy link

github-actions bot commented Aug 10, 2022

Asset Size Report for 5cf0ebf

Modern Builds

✅ EmberData shrank by -1.6 KB (-297.0 B compressed)

Warnings

⚠️ The uncompressed size of the package @ember-data/model has increased by +77.0 B.
⚠️ The uncompressed size of the package @ember-data/record-data has increased by +234.0 B.

Changeset


EmberData +169.04 KB -1.6 KB (+35.4 KB -297.0 B compressed)
    @ember-data/model +46.97 KB +77.0 B (+9.84 KB +14.0 B compressed)
        @ember-data/model/-private +46.5 KB +77.0 B (+9.74 KB +14.0 B compressed)
    @ember-data/store +43.39 KB -1.9 KB (+9.08 KB -353.53 B compressed)
        @ember-data/store/-private +42.39 KB -1.9 KB (+8.88 KB -353.53 B compressed)
    @ember-data/record-data +24.24 KB +234.0 B (+5.08 KB +42.53 B compressed)
        @ember-data/record-data/-private +24.24 KB +234.0 B (+5.08 KB +42.53 B compressed)

Full Asset Analysis (Modern)

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


Library: EmberData
┌────────────┬─────────────┐
│  (index)   │   Values    │
├────────────┼─────────────┤
│   bytes    │ '169.04 KB' │
│ compressed │ '35.40 KB'  │
│  packages  │      8      │
│  modules   │     44      │
└────────────┴─────────────┘

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '46.97 KB' │
│  compressed  │ '9.84 KB'  │
│ % Of Library │   '27.8'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/-private                        | 46.50 KB  | 9.74 KB    | 99.0          | 27.5
	@ember-data/model/index                           | 486.00 B  | 101.76 B   | 1.0           | 0.3

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '43.39 KB' │
│  compressed  │ '9.08 KB'  │
│ % Of Library │   '25.7'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/-private                        | 42.39 KB  | 8.88 KB    | 97.7          | 25.1
	@ember-data/store/index                           | 1022.00 B | 214.00 B   | 2.3           | 0.6

Package: @ember-data/record-data
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '24.24 KB' │
│  compressed  │ '5.08 KB'  │
│ % Of Library │   '14.3'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/record-data/-private                  | 24.24 KB  | 5.08 KB    | 100.0         | 14.3

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '20.42 KB' │
│  compressed  │ '4.28 KB'  │
│ % Of Library │   '12.1'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                       | 7.36 KB   | 1.54 KB    | 36.0          | 4.4
	@ember-data/serializer/-private                   | 5.60 KB   | 1.17 KB    | 27.4          | 3.3
	@ember-data/serializer/json-api                   | 3.79 KB   | 812.65 B   | 18.6          | 2.2
	@ember-data/serializer/rest                       | 2.87 KB   | 614.36 B   | 14.0          | 1.7
	@ember-data/serializer/index                      | 611.00 B  | 127.93 B   | 2.9           | 0.4
	@ember-data/serializer/transform                  | 215.00 B  | 45.01 B    | 1.0           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '15.93 KB' │
│  compressed  │ '3.34 KB'  │
│ % Of Library │   '9.4'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                          | 7.88 KB   | 1.65 KB    | 49.5          | 4.7
	@ember-data/adapter/-private                      | 3.79 KB   | 811.60 B   | 23.8          | 2.2
	@ember-data/adapter/error                         | 1.82 KB   | 390.72 B   | 11.4          | 1.1
	@ember-data/adapter/index                         | 1.41 KB   | 302.78 B   | 8.9           | 0.8
	@ember-data/adapter/json-api                      | 1.03 KB   | 221.74 B   | 6.5           | 0.6

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '8.66 KB' │
│  compressed  │ '1.81 KB' │
│ % Of Library │   '5.1'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.11 KB   | 452.07 B   | 24.4          | 1.2
	ember-data/-private                               | 1.75 KB   | 374.60 B   | 20.2          | 1.0
	ember-data/adapters/errors                        | 1.19 KB   | 254.83 B   | 13.7          | 0.7
	ember-data/setup-container                        | 368.00 B  | 77.05 B    | 4.2           | 0.2
	ember-data/relationships                          | 318.00 B  | 66.58 B    | 3.6           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 57.37 B    | 3.1           | 0.2
	ember-data/serializers/json-api                   | 251.00 B  | 52.55 B    | 2.8           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 51.30 B    | 2.8           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 50.88 B    | 2.7           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 50.88 B    | 2.7           | 0.1
	ember-data/transform                              | 241.00 B  | 50.46 B    | 2.7           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 49.62 B    | 2.7           | 0.1
	ember-data/serializer                             | 232.00 B  | 48.57 B    | 2.6           | 0.1
	ember-data/adapter                                | 226.00 B  | 47.32 B    | 2.5           | 0.1
	ember-data/model                                  | 222.00 B  | 46.48 B    | 2.5           | 0.1
	ember-data/store                                  | 222.00 B  | 46.48 B    | 2.5           | 0.1
	ember-data/attr                                   | 218.00 B  | 45.64 B    | 2.5           | 0.1
	ember-data/version                                | 161.00 B  | 33.71 B    | 1.8           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.67 KB' │
│  compressed  │ '1.40 KB' │
│ % Of Library │   '3.9'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.96 KB   | 635.29 B   | 44.4          | 1.8
	ember-inflector/lib/system/inflections            | 1.59 KB   | 340.68 B   | 23.8          | 0.9
	ember-inflector/lib/system                        | 471.00 B  | 98.62 B    | 6.9           | 0.3
	ember-inflector/index                             | 379.00 B  | 79.36 B    | 5.6           | 0.2
	ember-inflector/lib/helpers/pluralize             | 369.00 B  | 77.26 B    | 5.4           | 0.2
	ember-inflector/lib/utils/make-helper             | 332.00 B  | 69.51 B    | 4.9           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 66.58 B    | 4.7           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 61.98 B    | 4.3           | 0.2

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.77 KB'  │
│  compressed  │ '593.21 B' │
│ % Of Library │   '1.6'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.27 KB   | 487.46 B   | 82.2          | 1.3
	@ember-data/debug/setup                           | 505.00 B  | 105.74 B   | 17.8          | 0.3

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
Copy link

github-actions bot commented Aug 10, 2022

Performance Report for 5cf0ebf

Scenario - materialization: ✅ Performance improved

✅ duration
phase estimated improvement -17ms [-29ms to -4ms] OR -1.53% [-2.69% to -0.38%]
☑️ Phase [navigationStart] => [start-find-all]
phase no difference [-3ms to 4ms]
✅ Phase [start-find-all] => [start-materialization]
phase estimated improvement -11ms [-15ms to -8ms] OR -2.5% [-3.35% to -1.65%]
☑️ Phase [start-materialization] => [end-materialization]
phase no difference [-5ms to 2ms]
☑️ Phase [end-materialization] => [Test End]
phase no difference [0ms to 0ms]

Scenario - unload: ✅ Performance improved

✅ duration
phase estimated improvement -34ms [-45ms to -23ms] OR -2.65% [-3.51% to -1.8%]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-4ms to 5ms]
✅ Phase [start-push-payload] => [start-unload-records]
phase estimated improvement -30ms [-34ms to -27ms] OR -4.87% [-5.47% to -4.27%]
✅ Phase [start-unload-records] => [end-unload-records]
phase estimated improvement -5ms [-7ms to -2ms] OR -2.14% [-3.23% to -1.07%]
☑️ Phase [end-unload-records] => [Test End]
phase no difference [0ms to 0ms]

Scenario - destroy: ✅ Performance improved

✅ duration
phase estimated improvement -37ms [-49ms to -23ms] OR -2.58% [-3.45% to -1.62%]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-5ms to 6ms]
✅ Phase [start-push-payload] => [start-destroy-records]
phase estimated improvement -32ms [-37ms to -27ms] OR -5.06% [-5.84% to -4.35%]
✅ Phase [start-destroy-records] => [end-destroy-records]
phase estimated improvement -6ms [-8ms to -4ms] OR -1.82% [-2.42% to -1.15%]
☑️ Phase [end-destroy-records] => [Test End]
phase no difference [0ms to 0ms]

Scenario - add-children: ✅ Performance improved

✅ duration
phase estimated improvement -15ms [-26ms to -5ms] OR -1.72% [-3% to -0.63%]
☑️ Phase [navigationStart] => [start-push-initial-payload]
phase no difference [-9ms to 8ms]
✅ Phase [start-push-initial-payload] => [start-push-update-payload]
phase estimated improvement -13ms [-16ms to -11ms] OR -5.61% [-6.57% to -4.66%]
☑️ Phase [start-push-update-payload] => [end-push-update-payload]
phase no difference [-2ms to 1ms]
☑️ Phase [end-push-update-payload] => [Test End]
phase no difference [0ms to 0ms]

Scenario - unused-relationships: ✅ Performance improved

✅ duration
phase estimated improvement -31ms [-45ms to -15ms] OR -2.83% [-4.07% to -1.34%]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-3ms to 11ms]
✅ Phase [start-push-payload] => [end-push-payload]
phase estimated improvement -36ms [-41ms to -31ms] OR -5.65% [-6.49% to -4.83%]
☑️ Phase [end-push-payload] => [Test End]
phase no difference [0ms to 0ms]

@runspired runspired added the 🏷️ doc This PR adds/improves/or fixes documentation label Aug 11, 2022
@runspired runspired added this to In Development in 🌲 Project Trim 🌲 via automation Aug 11, 2022
@runspired runspired linked an issue Aug 11, 2022 that may be closed by this pull request
1 task
@runspired runspired merged commit 8e6b742 into master Aug 11, 2022
🌲 Project Trim 🌲 automation moved this from In Development to Completed Aug 11, 2022
@delete-merged-branch delete-merged-branch bot deleted the cache-v2.1/infra branch August 11, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 Roadmap 🎯 canary PR is targeting canary (default) 🏷️ deprecation 🏷️ doc This PR adds/improves/or fixes documentation 🏷️ feat This PR introduces a new feature 🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Document instantiateRecord and RFC#487 custom model class APIs
1 participant