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

chore: legacy-handler findRecord support #8476

Merged
merged 19 commits into from
Mar 19, 2023

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Mar 17, 2023

(1/4th of) the literal final step to complete #6166 💚

This PR:

  • findRecord as request op

Next PRs:

  • [-] saveRecord as request op
  • [-] findBelongsTo as request op
  • [-] findHasMany as request op

To Go (for full RequestManager support): (not this PR)

  • [-] enforce immutability in dev
  • [-] handle error documents in cache
  • [-] handle meta documents in cache
  • [-] additional test coverage for Store.request, errors thrown during request
  • [-] additional test coverage for cache.peek / cache.put / cache.peekRequest
  • [-] update docs for RequestManager.useCache
  • [-] implement new Collection mode to properly reflect ResourceDocument
  • [-] ensure single-resource-document requests are notified when data changes
  • [-] determine Cache "mutability" of CollectionResourceDocument
  • [-] add tests for enhancing context.request in RequestManager before calling next

Other Notes:

  • clarify intended Error handling mechanisms/propagation
  • update RFC for RequestManager.useCache
  • update RFC for lifetimes.isSoftExpired/isHardExpired
  • update RFC for rename data => content

@runspired runspired added 🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166 🎯 canary PR is targeting canary (default) 🏷️ chore This PR primarily refactors code or updates dependencies 5.0 Roadmap labels Mar 17, 2023
@runspired runspired added the ci-assetsize Activates Asset Size Checks in CI label Mar 17, 2023
@github-actions
Copy link

github-actions bot commented Mar 17, 2023

Asset Size Report for 9ff9bcc

Modern Builds

🛑 The size of the library EmberData has increased by +872.0 B (+35.0 B compressed) which exceeds the failure threshold of 75 bytes.

Warnings

⚠️ The uncompressed size of the package ember-data has increased by +32.0 B.
⚠️ The uncompressed size of the package @ember-data/request has increased by +217.0 B.
⚠️ The uncompressed size of the package @ember-data/legacy-compat has increased by +5.86 KB.

Changeset


EmberData 177.95 KB +872.0 B (38.31 KB +35.0 B compressed)
    @ember-data/store 37.36 KB -5.24 KB (8.04 KB -215.5 B compressed)
        @ember-data/store/index-3fe94044 0.0 B -39.64 KB (0.0 B -1.59 KB compressed)
        @ember-data/store/index-12f58a8b 34.4 KB +34.4 KB (7.41 KB +1.38 KB compressed)
    @ember-data/model 42.2 KB -4.0 B (9.08 KB -0.16 B compressed)
        @ember-data/model/has-many-ef93d559 0.0 B -40.35 KB (0.0 B -1.62 KB compressed)
        @ember-data/model/has-many-27395cb2 40.34 KB +40.34 KB (8.68 KB +1.62 KB compressed)
    ember-data 8.44 KB +32.0 B (1.82 KB +1.28 B compressed)
        ember-data/index 1.96 KB -2.0 B (432.67 B -0.08 B compressed)
        ember-data/-private 1.68 KB +34.0 B (370.03 B +1.36 B compressed)
    @ember-data/request 5.19 KB +217.0 B (1.12 KB +8.71 B compressed)
        @ember-data/request/index 4.8 KB +217.0 B (1.03 KB +8.71 B compressed)
    @ember-data/legacy-compat 8.95 KB +5.86 KB (1.93 KB +240.67 B compressed)
        @ember-data/legacy-compat/index 2.66 KB +559.0 B (585.94 B +22.44 B compressed)
        @ember-data/legacy-compat/snapshot-record-array-a4efeb60 0.0 B -724.0 B (0.0 B -29.06 B compressed)
        @ember-data/legacy-compat/-private 437.0 B +152.0 B (94.06 B +6.1 B compressed)
        @ember-data/legacy-compat/fetch-manager-2716abb1 5.87 KB +5.87 KB (1.26 KB +241.19 B compressed)

Full Asset Analysis (Modern)

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


Library: EmberData
┌────────────┬─────────────┐
│  (index)   │   Values    │
├────────────┼─────────────┤
│   bytes    │ '177.95 KB' │
│ compressed │ '38.31 KB'  │
│  packages  │     12      │
│  modules   │     58      │
└────────────┴─────────────┘

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '42.20 KB' │
│  compressed  │ '9.08 KB'  │
│ % Of Library │   '23.7'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/has-many-27395cb2               | 40.34 KB  | 8.68 KB    | 95.6          | 22.7
	@ember-data/model/-private                        | 1.40 KB   | 307.82 B   | 3.3           | 0.8
	@ember-data/model/index                           | 474.00 B  | 102.03 B   | 1.1           | 0.3

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '37.36 KB' │
│  compressed  │ '8.04 KB'  │
│ % Of Library │   '21.0'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/index-12f58a8b                  | 34.40 KB  | 7.41 KB    | 92.1          | 19.3
	@ember-data/store/-private                        | 2.09 KB   | 461.73 B   | 5.6           | 1.2
	@ember-data/store/index                           | 883.00 B  | 190.07 B   | 2.3           | 0.5

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '20.86 KB' │
│  compressed  │ '4.49 KB'  │
│ % Of Library │   '11.7'   │
└──────────────┴────────────┘
	Module                                                     | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                                | 7.30 KB   | 1.57 KB    | 35.0          | 4.1
	@ember-data/serializer/embedded-records-mixin-d75385ff     | 4.47 KB   | 984.82 B   | 21.4          | 2.5
	@ember-data/serializer/json-api                            | 3.77 KB   | 831.12 B   | 18.1          | 2.1
	@ember-data/serializer/rest                                | 2.83 KB   | 622.97 B   | 13.6          | 1.6
	@ember-data/serializer/-private                            | 1.41 KB   | 309.76 B   | 6.7           | 0.8
	@ember-data/serializer/index                               | 879.00 B  | 189.21 B   | 4.1           | 0.5
	@ember-data/serializer/transform                           | 234.00 B  | 50.37 B    | 1.1           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '17.78 KB' │
│  compressed  │ '3.83 KB'  │
│ % Of Library │   '10.0'   │
└──────────────┴────────────┘
	Module                                               | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                             | 7.68 KB   | 1.65 KB    | 43.2          | 4.3
	@ember-data/adapter/serialize-into-hash-bba9ba74     | 2.41 KB   | 531.91 B   | 13.6          | 1.4
	@ember-data/adapter/build-url-mixin-dff91ed0         | 1.91 KB   | 421.91 B   | 10.8          | 1.1
	@ember-data/adapter/error                            | 1.86 KB   | 410.07 B   | 10.5          | 1.0
	@ember-data/adapter/index-a70968d1                   | 1.67 KB   | 367.02 B   | 9.4           | 0.9
	@ember-data/adapter/json-api                         | 1.07 KB   | 235.49 B   | 6.0           | 0.6
	@ember-data/adapter/-private                         | 835.00 B  | 179.74 B   | 4.6           | 0.5
	@ember-data/adapter/index                            | 375.00 B  | 80.72 B    | 2.1           | 0.2

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

Package: @ember-data/json-api
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '9.57 KB' │
│  compressed  │ '2.06 KB' │
│ % Of Library │   '5.4'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/json-api/index                        | 9.57 KB   | 2.06 KB    | 100.0         | 5.4

Package: @ember-data/legacy-compat
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '8.95 KB' │
│  compressed  │ '1.93 KB' │
│ % Of Library │   '5.0'   │
└──────────────┴───────────┘
	Module                                               | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------
	@ember-data/legacy-compat/fetch-manager-2716abb1     | 5.87 KB   | 1.26 KB    | 65.5          | 3.3
	@ember-data/legacy-compat/index                      | 2.66 KB   | 585.94 B   | 29.7          | 1.5
	@ember-data/legacy-compat/-private                   | 437.00 B  | 94.06 B    | 4.8           | 0.2

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '8.44 KB' │
│  compressed  │ '1.82 KB' │
│ % Of Library │   '4.7'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 1.96 KB   | 432.67 B   | 23.2          | 1.1
	ember-data/-private                               | 1.68 KB   | 370.03 B   | 19.9          | 0.9
	ember-data/adapters/errors                        | 1.19 KB   | 261.97 B   | 14.1          | 0.7
	ember-data/setup-container                        | 367.00 B  | 79.00 B    | 4.2           | 0.2
	ember-data/relationships                          | 318.00 B  | 68.45 B    | 3.7           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 58.98 B    | 3.2           | 0.2
	ember-data/serializers/json-api                   | 251.00 B  | 54.03 B    | 2.9           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 52.73 B    | 2.8           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 52.30 B    | 2.8           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 52.30 B    | 2.8           | 0.1
	ember-data/transform                              | 241.00 B  | 51.87 B    | 2.8           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 51.01 B    | 2.7           | 0.1
	ember-data/serializer                             | 232.00 B  | 49.94 B    | 2.7           | 0.1
	ember-data/adapter                                | 226.00 B  | 48.64 B    | 2.6           | 0.1
	ember-data/model                                  | 222.00 B  | 47.78 B    | 2.6           | 0.1
	ember-data/store                                  | 222.00 B  | 47.78 B    | 2.6           | 0.1
	ember-data/attr                                   | 218.00 B  | 46.92 B    | 2.5           | 0.1
	ember-data/version                                | 162.00 B  | 34.87 B    | 1.9           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.69 KB' │
│  compressed  │ '1.44 KB' │
│ % Of Library │   '3.8'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.99 KB   | 658.48 B   | 44.7          | 1.7
	ember-inflector/lib/system/inflections            | 1.59 KB   | 350.23 B   | 23.7          | 0.9
	ember-inflector/lib/system                        | 471.00 B  | 101.38 B   | 6.9           | 0.3
	ember-inflector/index                             | 379.00 B  | 81.58 B    | 5.5           | 0.2
	ember-inflector/lib/helpers/pluralize             | 369.00 B  | 79.43 B    | 5.4           | 0.2
	ember-inflector/lib/utils/make-helper             | 332.00 B  | 71.46 B    | 4.8           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 68.45 B    | 4.6           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 63.71 B    | 4.3           | 0.2

Package: @ember-data/request
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '5.19 KB' │
│  compressed  │ '1.12 KB' │
│ % Of Library │   '2.9'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/request/index                         | 4.80 KB   | 1.03 KB    | 92.5          | 2.7
	@ember-data/request/fetch                         | 397.00 B  | 85.45 B    | 7.5           | 0.2

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '3.03 KB'  │
│  compressed  │ '667.96 B' │
│ % Of Library │   '1.7'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.28 KB   | 503.06 B   | 75.3          | 1.3
	@ember-data/debug/setup                           | 766.00 B  | 164.89 B   | 24.7          | 0.4

Package: @ember-data/tracking
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '1.24 KB'  │
│  compressed  │ '272.73 B' │
│ % Of Library │   '0.7'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/tracking/-private                     | 839.00 B  | 180.60 B   | 66.2          | 0.5
	@ember-data/tracking/index                        | 428.00 B  | 92.12 B    | 33.8          | 0.2

@runspired runspired force-pushed the feat/legacy-find-record-handler branch 2 times, most recently from aac6e42 to deec267 Compare March 18, 2023 01:34
@runspired runspired force-pushed the feat/legacy-find-record-handler branch from 6ae2d2f to 5911d5f Compare March 18, 2023 08:57
@runspired runspired merged commit 8614c57 into main Mar 19, 2023
@delete-merged-branch delete-merged-branch bot deleted the feat/legacy-find-record-handler branch March 19, 2023 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 Roadmap ci-assetsize Activates Asset Size Checks in CI 🎯 canary PR is targeting canary (default) 🏷️ chore This PR primarily refactors code or updates dependencies 🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant