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: refactor model hook support to live in the model package #8499

Merged
merged 12 commits into from
Jul 14, 2023

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Mar 26, 2023

Users of @ember-data/store vs ember-data/store will have some additional configuration requirements now if using the @ember-data/json-api and @ember-data/model packages still.

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ chore This PR primarily refactors code or updates dependencies ci-assetsize Activates Asset Size Checks in CI labels Mar 26, 2023
@github-actions
Copy link

github-actions bot commented Mar 26, 2023

Asset Size Report for bd6bc85

Modern Builds

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

Warnings

⚠️ The uncompressed size of the package @ember-data/model has increased by +2.9 KB.
⚠️ The uncompressed size of the package @ember-data/graph has increased by +14.0 B.
⚠️ The uncompressed size of the package ember-data has increased by +530.0 B.

Changeset


EmberData 184.61 KB +1.55 KB (39.57 KB +172.0 B compressed)
    @ember-data/model 42.37 KB +2.9 KB (9.08 KB +322.39 B compressed)
        @ember-data/model/has-many-2baf73c0 0.0 B -37.91 KB (0.0 B -4.12 KB compressed)
        @ember-data/model/-private 928.0 B -192.0 B (198.89 B -20.85 B compressed)
        @ember-data/model/index 890.0 B +416.0 B (190.75 B +45.17 B compressed)
        @ember-data/model/model-99cdd629 36.7 KB +36.7 KB (7.86 KB +3.98 KB compressed)
        @ember-data/model/hooks-f9d9fb4f 1.81 KB +1.81 KB (396.93 B +201.1 B compressed)
        @ember-data/model/has-many-435cd213 1.61 KB +1.61 KB (352.35 B +178.52 B compressed)
        @ember-data/model/hooks 494.0 B +494.0 B (105.87 B +53.64 B compressed)
    @ember-data/store 35.22 KB -1.88 KB (7.55 KB -209.46 B compressed)
        @ember-data/store/store-service-4e1e7840 0.0 B -34.22 KB (0.0 B -3.72 KB compressed)
        @ember-data/store/-private 2.26 KB +251.0 B (497.02 B +27.26 B compressed)
        @ember-data/store/store-service-7750e2f0 32.09 KB +32.09 KB (6.88 KB +3.48 KB compressed)
    @ember-data/graph 16.71 KB +14.0 B (3.58 KB +1.52 B compressed)
        @ember-data/graph/-private 16.71 KB +14.0 B (3.58 KB +1.52 B compressed)
    ember-data 8.36 KB +530.0 B (1.79 KB +57.55 B compressed)
        ember-data/-private 2.12 KB +530.0 B (464.65 B +57.55 B compressed)

Full Asset Analysis (Modern)

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


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

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '42.37 KB' │
│  compressed  │ '9.08 KB'  │
│ % Of Library │   '22.9'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/model-99cdd629                  | 36.70 KB  | 7.86 KB    | 86.6          | 19.9
	@ember-data/model/hooks-f9d9fb4f                  | 1.81 KB   | 396.93 B   | 4.3           | 1.0
	@ember-data/model/has-many-435cd213               | 1.61 KB   | 352.35 B   | 3.8           | 0.9
	@ember-data/model/-private                        | 928.00 B  | 198.89 B   | 2.1           | 0.5
	@ember-data/model/index                           | 890.00 B  | 190.75 B   | 2.1           | 0.5
	@ember-data/model/hooks                           | 494.00 B  | 105.87 B   | 1.1           | 0.3

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '35.22 KB' │
│  compressed  │ '7.55 KB'  │
│ % Of Library │   '19.1'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/store-service-7750e2f0          | 32.09 KB  | 6.88 KB    | 91.1          | 17.4
	@ember-data/store/-private                        | 2.26 KB   | 497.02 B   | 6.4           | 1.2
	@ember-data/store/index                           | 885.00 B  | 189.67 B   | 2.5           | 0.5

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '20.86 KB' │
│  compressed  │ '4.47 KB'  │
│ % Of Library │   '11.3'   │
└──────────────┴────────────┘
	Module                                                     | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                                | 7.30 KB   | 1.56 KB    | 35.0          | 4.0
	@ember-data/serializer/embedded-records-mixin-d75385ff     | 4.47 KB   | 980.54 B   | 21.4          | 2.4
	@ember-data/serializer/json-api                            | 3.77 KB   | 827.51 B   | 18.1          | 2.0
	@ember-data/serializer/rest                                | 2.83 KB   | 620.26 B   | 13.6          | 1.5
	@ember-data/serializer/-private                            | 1.41 KB   | 308.41 B   | 6.7           | 0.8
	@ember-data/serializer/index                               | 879.00 B  | 188.39 B   | 4.1           | 0.5
	@ember-data/serializer/transform                           | 234.00 B  | 50.15 B    | 1.1           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '17.51 KB' │
│  compressed  │ '3.75 KB'  │
│ % Of Library │   '9.5'    │
└──────────────┴────────────┘
	Module                                               | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                             | 7.67 KB   | 1.64 KB    | 43.8          | 4.2
	@ember-data/adapter/serialize-into-hash-b9092b25     | 2.40 KB   | 527.67 B   | 13.7          | 1.3
	@ember-data/adapter/build-url-mixin-18db8c8b         | 1.91 KB   | 420.08 B   | 10.9          | 1.0
	@ember-data/adapter/error                            | 1.80 KB   | 394.14 B   | 10.3          | 1.0
	@ember-data/adapter/index-f54121ea                   | 1.48 KB   | 324.49 B   | 8.4           | 0.8
	@ember-data/adapter/json-api                         | 1.07 KB   | 234.47 B   | 6.1           | 0.6
	@ember-data/adapter/-private                         | 835.00 B  | 178.96 B   | 4.7           | 0.4
	@ember-data/adapter/index                            | 375.00 B  | 80.37 B    | 2.1           | 0.2

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

Package: @ember-data/legacy-compat
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '15.21 KB' │
│  compressed  │ '3.26 KB'  │
│ % Of Library │   '8.2'    │
└──────────────┴────────────┘
	Module                                               | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------
	@ember-data/legacy-compat/fetch-manager-2159833e     | 8.20 KB   | 1.76 KB    | 53.9          | 4.4
	@ember-data/legacy-compat/index                      | 6.50 KB   | 1.39 KB    | 42.8          | 3.5
	@ember-data/legacy-compat/-private                   | 516.00 B  | 110.59 B   | 3.3           | 0.3

Package: @ember-data/json-api
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '11.93 KB' │
│  compressed  │ '2.56 KB'  │
│ % Of Library │   '6.5'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/json-api/index                        | 10.52 KB  | 2.26 KB    | 88.2          | 5.7
	@ember-data/json-api/request                      | 1.41 KB   | 309.27 B   | 11.8          | 0.8

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '8.36 KB' │
│  compressed  │ '1.79 KB' │
│ % Of Library │   '4.5'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/-private                               | 2.12 KB   | 464.65 B   | 25.3          | 1.1
	ember-data/index                                  | 1.74 KB   | 381.92 B   | 20.8          | 0.9
	ember-data/adapters/errors                        | 1009.00 B | 216.25 B   | 11.8          | 0.5
	ember-data/relationships                          | 318.00 B  | 68.15 B    | 3.7           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 58.72 B    | 3.2           | 0.1
	ember-data/setup-container                        | 272.00 B  | 58.29 B    | 3.2           | 0.1
	ember-data/serializers/json-api                   | 251.00 B  | 53.79 B    | 2.9           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 52.50 B    | 2.9           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 52.08 B    | 2.8           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 52.08 B    | 2.8           | 0.1
	ember-data/transform                              | 241.00 B  | 51.65 B    | 2.8           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 50.79 B    | 2.8           | 0.1
	ember-data/serializer                             | 232.00 B  | 49.72 B    | 2.7           | 0.1
	ember-data/adapter                                | 226.00 B  | 48.43 B    | 2.6           | 0.1
	ember-data/model                                  | 222.00 B  | 47.58 B    | 2.6           | 0.1
	ember-data/store                                  | 222.00 B  | 47.58 B    | 2.6           | 0.1
	ember-data/attr                                   | 218.00 B  | 46.72 B    | 2.5           | 0.1
	ember-data/version                                | 161.00 B  | 34.50 B    | 1.9           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.69 KB' │
│  compressed  │ '1.43 KB' │
│ % Of Library │   '3.6'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.99 KB   | 655.62 B   | 44.7          | 1.6
	ember-inflector/lib/system/inflections            | 1.59 KB   | 348.70 B   | 23.7          | 0.9
	ember-inflector/lib/system                        | 471.00 B  | 100.94 B   | 6.9           | 0.2
	ember-inflector/index                             | 379.00 B  | 81.22 B    | 5.5           | 0.2
	ember-inflector/lib/helpers/pluralize             | 369.00 B  | 79.08 B    | 5.4           | 0.2
	ember-inflector/lib/utils/make-helper             | 332.00 B  | 71.15 B    | 4.8           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 68.15 B    | 4.6           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 63.44 B    | 4.3           | 0.2

Package: @ember-data/request
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '5.76 KB' │
│  compressed  │ '1.23 KB' │
│ % Of Library │   '3.1'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/request/index                         | 5.22 KB   | 1.12 KB    | 90.5          | 2.8
	@ember-data/request/fetch                         | 559.00 B  | 119.80 B   | 9.5           | 0.3

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.75 KB'  │
│  compressed  │ '603.33 B' │
│ % Of Library │   '1.5'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.75 KB   | 603.33 B   | 100.0         | 1.5

Package: @ember-data/tracking
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '1.24 KB'  │
│  compressed  │ '273.05 B' │
│ % Of Library │   '0.7'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/tracking/-private                     | 846.00 B  | 181.31 B   | 66.4          | 0.4
	@ember-data/tracking/index                        | 428.00 B  | 91.73 B    | 33.6          | 0.2

@runspired runspired force-pushed the refactor-model-hooks branch from 3003386 to b6b64dd Compare July 14, 2023 08:11
@runspired runspired merged commit e9e54e4 into main Jul 14, 2023
@delete-merged-branch delete-merged-branch bot deleted the refactor-model-hooks branch July 14, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-assetsize Activates Asset Size Checks in CI 🎯 canary PR is targeting canary (default) 🏷️ chore This PR primarily refactors code or updates dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant