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: cleanup Implicit relationships #7463

Merged
merged 3 commits into from
Apr 16, 2021
Merged

Conversation

runspired
Copy link
Contributor

improves our typing throughout which allows us to drop some checks and extra initializations, makes where/when we are operating on an implicit relationship more clear (by using a flag instead of juggling keys). This allows us to have a single inverse key vs an inverseKey and inverseKeyForImplicit.

Only behavior change is that implicit keys are improved: before we were setting them to undefined${this.key} at all times, which is the reason for the (single) test change.

Motivation is to more closely align the current state with my next PR so that these somewhat more cosmetic changes are more easily distinguished from the logical changes.

@github-actions
Copy link

github-actions bot commented Apr 15, 2021

Asset Size Report for 257e4cd

IE11 Builds

EmberData shrank by 229.0 B (-38.0 B compressed)

Warnings

The uncompressed size of the package @ember-data/model has increased by 976.0 B.

Changeset


EmberData 158.77 KB -229.0 B (34.33 KB +38.0 B compressed)
    @ember-data/store 68.25 KB -1.11 KB (14.76 KB +188.34 B compressed)
        @ember-data/store/-private 67.34 KB -1.11 KB (14.56 KB +188.34 B compressed)
    @ember-data/record-data 22.0 KB -70.0 B (4.76 KB +11.62 B compressed)
        @ember-data/record-data/-private 22.0 KB -70.0 B (4.76 KB +11.62 B compressed)
    @ember-data/model 14.54 KB +976.0 B (3.14 KB -161.96 B compressed)
        @ember-data/model/-private 14.06 KB +976.0 B (3.04 KB -161.96 B compressed)

Full Asset Analysis (IE11)

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


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

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '68.25 KB' │
│  compressed  │ '14.76 KB' │
│ % Of Library │   '43.0'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/-private                        | 67.34 KB  | 14.56 KB   | 98.7          | 42.4
	@ember-data/store/index                           | 936.00 B  | 202.41 B   | 1.3           | 0.6

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

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '19.37 KB' │
│  compressed  │ '4.19 KB'  │
│ % Of Library │   '12.2'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                       | 7.12 KB   | 1.54 KB    | 36.8          | 4.5
	@ember-data/serializer/-private                   | 5.37 KB   | 1.16 KB    | 27.7          | 3.4
	@ember-data/serializer/json-api                   | 3.72 KB   | 823.07 B   | 19.2          | 2.3
	@ember-data/serializer/rest                       | 2.71 KB   | 600.76 B   | 14.0          | 1.7
	@ember-data/serializer/index                      | 243.00 B  | 52.55 B    | 1.2           | 0.1
	@ember-data/serializer/transform                  | 215.00 B  | 46.49 B    | 1.1           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '16.02 KB' │
│  compressed  │ '3.46 KB'  │
│ % Of Library │   '10.1'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                          | 8.37 KB   | 1.81 KB    | 52.2          | 5.3
	@ember-data/adapter/-private                      | 3.58 KB   | 793.66 B   | 22.4          | 2.3
	@ember-data/adapter/error                         | 1.91 KB   | 423.64 B   | 11.9          | 1.2
	@ember-data/adapter/index                         | 1.14 KB   | 251.72 B   | 7.1           | 0.7
	@ember-data/adapter/json-api                      | 1.02 KB   | 225.55 B   | 6.4           | 0.6

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '14.54 KB' │
│  compressed  │ '3.14 KB'  │
│ % Of Library │   '9.2'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/-private                        | 14.06 KB  | 3.04 KB    | 96.7          | 8.9
	@ember-data/model/index                           | 486.00 B  | 105.10 B   | 3.3           | 0.3

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '9.24 KB' │
│  compressed  │ '2.00 KB' │
│ % Of Library │   '5.8'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.32 KB   | 514.47 B   | 25.1          | 1.5
	ember-data/-private                               | 1.98 KB   | 438.78 B   | 21.4          | 1.2
	ember-data/adapters/errors                        | 1.19 KB   | 263.18 B   | 12.9          | 0.7
	ember-data/setup-container                        | 503.00 B  | 108.77 B   | 5.3           | 0.3
	ember-data/relationships                          | 318.00 B  | 68.76 B    | 3.4           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 59.25 B    | 2.9           | 0.2
	ember-data/serializers/json-api                   | 251.00 B  | 54.28 B    | 2.7           | 0.2
	ember-data/adapters/json-api                      | 245.00 B  | 52.98 B    | 2.6           | 0.2
	ember-data/serializers/json                       | 243.00 B  | 52.55 B    | 2.6           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 52.55 B    | 2.6           | 0.1
	ember-data/transform                              | 241.00 B  | 52.11 B    | 2.5           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 51.25 B    | 2.5           | 0.1
	ember-data/serializer                             | 232.00 B  | 50.17 B    | 2.5           | 0.1
	ember-data/adapter                                | 226.00 B  | 48.87 B    | 2.4           | 0.1
	ember-data/model                                  | 222.00 B  | 48.00 B    | 2.3           | 0.1
	ember-data/store                                  | 222.00 B  | 48.00 B    | 2.3           | 0.1
	ember-data/attr                                   | 218.00 B  | 47.14 B    | 2.3           | 0.1
	ember-data/version                                | 162.00 B  | 35.03 B    | 1.7           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.66 KB' │
│  compressed  │ '1.44 KB' │
│ % Of Library │   '4.2'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.88 KB   | 637.74 B   | 43.3          | 1.8
	ember-inflector/lib/system/inflections            | 1.59 KB   | 351.84 B   | 23.9          | 1.0
	ember-inflector/index                             | 473.00 B  | 102.28 B   | 6.9           | 0.3
	ember-inflector/lib/system                        | 471.00 B  | 101.85 B   | 6.9           | 0.3
	ember-inflector/lib/helpers/pluralize             | 373.00 B  | 80.66 B    | 5.5           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 68.76 B    | 4.7           | 0.2
	ember-inflector/lib/utils/make-helper             | 308.00 B  | 66.60 B    | 4.5           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 64.01 B    | 4.3           | 0.2

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.70 KB'  │
│  compressed  │ '597.95 B' │
│ % Of Library │   '1.7'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.21 KB   | 490.03 B   | 82.0          | 1.4
	@ember-data/debug/setup                           | 499.00 B  | 107.91 B   | 18.0          | 0.3

Modern Builds

EmberData shrank by 229.0 B (-38.0 B compressed)

Warnings

The uncompressed size of the package @ember-data/model has increased by 976.0 B.

Changeset


EmberData 158.77 KB -229.0 B (34.33 KB +38.0 B compressed)
    @ember-data/store 68.25 KB -1.11 KB (14.76 KB +188.34 B compressed)
        @ember-data/store/-private 67.34 KB -1.11 KB (14.56 KB +188.34 B compressed)
    @ember-data/record-data 22.0 KB -70.0 B (4.76 KB +11.62 B compressed)
        @ember-data/record-data/-private 22.0 KB -70.0 B (4.76 KB +11.62 B compressed)
    @ember-data/model 14.54 KB +976.0 B (3.14 KB -161.96 B compressed)
        @ember-data/model/-private 14.06 KB +976.0 B (3.04 KB -161.96 B compressed)

Full Asset Analysis (Modern)

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


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

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '68.25 KB' │
│  compressed  │ '14.76 KB' │
│ % Of Library │   '43.0'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/-private                        | 67.34 KB  | 14.56 KB   | 98.7          | 42.4
	@ember-data/store/index                           | 936.00 B  | 202.41 B   | 1.3           | 0.6

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

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '19.37 KB' │
│  compressed  │ '4.19 KB'  │
│ % Of Library │   '12.2'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                       | 7.12 KB   | 1.54 KB    | 36.8          | 4.5
	@ember-data/serializer/-private                   | 5.37 KB   | 1.16 KB    | 27.7          | 3.4
	@ember-data/serializer/json-api                   | 3.72 KB   | 823.07 B   | 19.2          | 2.3
	@ember-data/serializer/rest                       | 2.71 KB   | 600.76 B   | 14.0          | 1.7
	@ember-data/serializer/index                      | 243.00 B  | 52.55 B    | 1.2           | 0.1
	@ember-data/serializer/transform                  | 215.00 B  | 46.49 B    | 1.1           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '16.02 KB' │
│  compressed  │ '3.46 KB'  │
│ % Of Library │   '10.1'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                          | 8.37 KB   | 1.81 KB    | 52.2          | 5.3
	@ember-data/adapter/-private                      | 3.58 KB   | 793.66 B   | 22.4          | 2.3
	@ember-data/adapter/error                         | 1.91 KB   | 423.64 B   | 11.9          | 1.2
	@ember-data/adapter/index                         | 1.14 KB   | 251.72 B   | 7.1           | 0.7
	@ember-data/adapter/json-api                      | 1.02 KB   | 225.55 B   | 6.4           | 0.6

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '14.54 KB' │
│  compressed  │ '3.14 KB'  │
│ % Of Library │   '9.2'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/-private                        | 14.06 KB  | 3.04 KB    | 96.7          | 8.9
	@ember-data/model/index                           | 486.00 B  | 105.10 B   | 3.3           | 0.3

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '9.24 KB' │
│  compressed  │ '2.00 KB' │
│ % Of Library │   '5.8'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.32 KB   | 514.47 B   | 25.1          | 1.5
	ember-data/-private                               | 1.98 KB   | 438.78 B   | 21.4          | 1.2
	ember-data/adapters/errors                        | 1.19 KB   | 263.18 B   | 12.9          | 0.7
	ember-data/setup-container                        | 503.00 B  | 108.77 B   | 5.3           | 0.3
	ember-data/relationships                          | 318.00 B  | 68.76 B    | 3.4           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 59.25 B    | 2.9           | 0.2
	ember-data/serializers/json-api                   | 251.00 B  | 54.28 B    | 2.7           | 0.2
	ember-data/adapters/json-api                      | 245.00 B  | 52.98 B    | 2.6           | 0.2
	ember-data/serializers/json                       | 243.00 B  | 52.55 B    | 2.6           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 52.55 B    | 2.6           | 0.1
	ember-data/transform                              | 241.00 B  | 52.11 B    | 2.5           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 51.25 B    | 2.5           | 0.1
	ember-data/serializer                             | 232.00 B  | 50.17 B    | 2.5           | 0.1
	ember-data/adapter                                | 226.00 B  | 48.87 B    | 2.4           | 0.1
	ember-data/model                                  | 222.00 B  | 48.00 B    | 2.3           | 0.1
	ember-data/store                                  | 222.00 B  | 48.00 B    | 2.3           | 0.1
	ember-data/attr                                   | 218.00 B  | 47.14 B    | 2.3           | 0.1
	ember-data/version                                | 162.00 B  | 35.03 B    | 1.7           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.66 KB' │
│  compressed  │ '1.44 KB' │
│ % Of Library │   '4.2'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.88 KB   | 637.74 B   | 43.3          | 1.8
	ember-inflector/lib/system/inflections            | 1.59 KB   | 351.84 B   | 23.9          | 1.0
	ember-inflector/index                             | 473.00 B  | 102.28 B   | 6.9           | 0.3
	ember-inflector/lib/system                        | 471.00 B  | 101.85 B   | 6.9           | 0.3
	ember-inflector/lib/helpers/pluralize             | 373.00 B  | 80.66 B    | 5.5           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 68.76 B    | 4.7           | 0.2
	ember-inflector/lib/utils/make-helper             | 308.00 B  | 66.60 B    | 4.5           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 64.01 B    | 4.3           | 0.2

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.70 KB'  │
│  compressed  │ '597.95 B' │
│ % Of Library │   '1.7'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.21 KB   | 490.03 B   | 82.0          | 1.4
	@ember-data/debug/setup                           | 499.00 B  | 107.91 B   | 18.0          | 0.3

Modern Builds (No Rollup)

EmberData shrank by 428.0 B (-67.0 B compressed)

Warnings

The uncompressed size of the package @ember-data/record-data has increased by 99.0 B.
The uncompressed size of the package @ember-data/model has increased by 1.34 KB.

Changeset


EmberData 202.85 KB -428.0 B (38.8 KB +67.0 B compressed)
    @ember-data/store 99.59 KB -1.85 KB (19.05 KB +297.27 B compressed)
        @ember-data/store/-private/index 4.16 KB -282.0 B (814.85 B +44.14 B compressed)
        @ember-data/store/-private/system/store/record-data-store-wrapper 3.33 KB -94.0 B (651.31 B +14.71 B compressed)
        @ember-data/store/-private/system/relationship-meta 0.0 B -1.45 KB (0.0 B +232.0 B compressed)
        @ember-data/store/-private/ts-interfaces/record-data-schemas 89.0 B -41.0 B (17.02 B +6.42 B compressed)
    @ember-data/record-data 25.64 KB +99.0 B (4.91 KB -15.5 B compressed)
        @ember-data/record-data/-private/relationships/state/relationship 7.9 KB +156.0 B (1.51 KB -24.42 B compressed)
        @ember-data/record-data/-private/relationships/state/belongs-to 2.92 KB -30.0 B (572.88 B +4.7 B compressed)
        @ember-data/record-data/-private/relationships/state/has-many 2.67 KB -15.0 B (522.96 B +2.35 B compressed)
        @ember-data/record-data/-private/index 1017.0 B -6.0 B (194.53 B +0.94 B compressed)
        @ember-data/record-data/-private/record-data-for 0.0 B -481.0 B (0.0 B +75.3 B compressed)
        @ember-data/record-data/-private/accessors 475.0 B +475.0 B (90.85 B -74.36 B compressed)
    @ember-data/model 18.86 KB +1.34 KB (3.61 KB -214.78 B compressed)
        @ember-data/model/-private/system/relationships/ext 1.23 KB +39.0 B (241.01 B -6.11 B compressed)
        @ember-data/model/-private/system/relationships/relationship-meta 1.3 KB +1.3 KB (254.97 B -208.67 B compressed)

Full Asset Analysis (Modern)

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


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

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '99.59 KB' │
│  compressed  │ '19.05 KB' │
│ % Of Library │   '49.1'   │
└──────────────┴────────────┘
	Module                                                                             | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------------------------------------
	@ember-data/store/-private/system/core-store                                       | 17.01 KB  | 3.25 KB    | 17.1          | 8.4
	@ember-data/store/-private/system/model/internal-model                             | 16.32 KB  | 3.12 KB    | 16.4          | 8.0
	@ember-data/store/-private/system/model/states                                     | 5.44 KB   | 1.04 KB    | 5.5           | 2.7
	@ember-data/store/-private/system/fetch-manager                                    | 4.96 KB   | 971.90 B   | 5.0           | 2.4
	@ember-data/store/-private/system/record-array-manager                             | 4.47 KB   | 874.72 B   | 4.5           | 2.2
	@ember-data/store/-private/system/store/finders                                    | 4.35 KB   | 852.73 B   | 4.4           | 2.1
	@ember-data/store/-private/index                                                   | 4.16 KB   | 814.85 B   | 4.2           | 2.1
	@ember-data/store/-private/identifiers/cache                                       | 3.86 KB   | 756.32 B   | 3.9           | 1.9
	@ember-data/store/-private/system/store/record-data-store-wrapper                  | 3.33 KB   | 651.31 B   | 3.3           | 1.6
	@ember-data/store/-private/system/store/internal-model-factory                     | 2.91 KB   | 570.20 B   | 2.9           | 1.4
	@ember-data/store/-private/system/snapshot                                         | 2.85 KB   | 558.34 B   | 2.9           | 1.4
	@ember-data/store/-private/system/record-arrays/record-array                       | 2.25 KB   | 440.52 B   | 2.3           | 1.1
	@ember-data/store/-private/system/ds-model-store                                   | 1.99 KB   | 389.83 B   | 2.0           | 1.0
	@ember-data/store/-private/system/request-cache                                    | 1.89 KB   | 369.36 B   | 1.9           | 0.9
	@ember-data/store/-private/system/references/has-many                              | 1.51 KB   | 294.95 B   | 1.5           | 0.7
	@ember-data/store/-private/system/schema-definition-service                        | 1.47 KB   | 288.64 B   | 1.5           | 0.7
	@ember-data/store/-private/system/model/shim-model-class                           | 1.27 KB   | 248.66 B   | 1.3           | 0.6
	@ember-data/store/-private/system/references/belongs-to                            | 1.24 KB   | 242.16 B   | 1.2           | 0.6
	@ember-data/store/-private/system/store/serializer-response                        | 1.12 KB   | 220.16 B   | 1.1           | 0.6
	@ember-data/store/-private/identifiers/utils/uuid-v4                               | 1.05 KB   | 206.20 B   | 1.1           | 0.5
	@ember-data/store/-private/system/internal-model-map                               | 983.00 B  | 188.02 B   | 1.0           | 0.5
	@ember-data/store/-private/system/references/record                                | 968.00 B  | 185.16 B   | 0.9           | 0.5
	@ember-data/store/index                                                            | 936.00 B  | 179.03 B   | 0.9           | 0.5
	@ember-data/store/-private/system/references/reference                             | 917.00 B  | 175.40 B   | 0.9           | 0.4
	@ember-data/store/-private/system/record-arrays/adapter-populated-record-array     | 892.00 B  | 170.62 B   | 0.9           | 0.4
	@ember-data/store/-private/system/model/notify-changes                             | 866.00 B  | 165.64 B   | 0.8           | 0.4
	@ember-data/store/-private/system/errors-utils                                     | 764.00 B  | 146.13 B   | 0.7           | 0.4
	@ember-data/store/-private/system/snapshot-record-array                            | 753.00 B  | 144.03 B   | 0.7           | 0.4
	@ember-data/store/-private/system/record-notification-manager                      | 689.00 B  | 131.79 B   | 0.7           | 0.3
	@ember-data/store/-private/system/references                                       | 598.00 B  | 114.38 B   | 0.6           | 0.3
	@ember-data/store/-private/system/promise-proxies                                  | 556.00 B  | 106.35 B   | 0.5           | 0.3
	@ember-data/store/-private/utils/construct-resource                                | 506.00 B  | 96.78 B    | 0.5           | 0.2
	@ember-data/store/-private/system/store/common                                     | 505.00 B  | 96.59 B    | 0.5           | 0.2
	@ember-data/store/-private/system/coerce-id                                        | 496.00 B  | 94.87 B    | 0.5           | 0.2
	@ember-data/store/-private/system/record-arrays                                    | 487.00 B  | 93.15 B    | 0.5           | 0.2
	@ember-data/store/-private/system/identity-map                                     | 450.00 B  | 86.07 B    | 0.4           | 0.2
	@ember-data/store/-private/system/diff-array                                       | 438.00 B  | 83.78 B    | 0.4           | 0.2
	@ember-data/store/-private/ts-interfaces/identifier                                | 400.00 B  | 76.51 B    | 0.4           | 0.2
	@ember-data/store/-private/utils/symbol                                            | 393.00 B  | 75.17 B    | 0.4           | 0.2
	@ember-data/store/-private/identifiers/is-stable-identifier                        | 327.00 B  | 62.54 B    | 0.3           | 0.2
	@ember-data/store/-private/ts-interfaces/fetch-manager                             | 316.00 B  | 60.44 B    | 0.3           | 0.2
	@ember-data/store/-private/utils/promise-record                                    | 290.00 B  | 55.47 B    | 0.3           | 0.1
	@ember-data/store/-private/system/backburner                                       | 268.00 B  | 51.26 B    | 0.3           | 0.1
	@ember-data/store/-private/utils/brand                                             | 258.00 B  | 49.35 B    | 0.3           | 0.1
	@ember-data/store/-private/system/record-data-for                                  | 235.00 B  | 44.95 B    | 0.2           | 0.1
	@ember-data/store/-private/system/ts-upgrade-map                                   | 234.00 B  | 44.75 B    | 0.2           | 0.1
	@ember-data/store/-private/system/normalize-model-name                             | 220.00 B  | 42.08 B    | 0.2           | 0.1
	@ember-data/store/-private/utils/is-non-empty-string                               | 212.00 B  | 40.55 B    | 0.2           | 0.1
	@ember-data/store/-debug/index                                                     | 193.00 B  | 36.91 B    | 0.2           | 0.1
	@ember-data/store/-private/system/deprecated-evented                               | 190.00 B  | 36.34 B    | 0.2           | 0.1
	@ember-data/store/-private/ts-interfaces/record-data-store-wrapper                 | 136.00 B  | 26.01 B    | 0.1           | 0.1
	@ember-data/store/-private/ts-interfaces/minimum-serializer-interface              | 98.00 B   | 18.74 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data-record-wrapper                | 96.00 B   | 18.36 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/minimum-adapter-interface                 | 95.00 B   | 18.17 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/schema-definition-service                 | 95.00 B   | 18.17 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data-json-api                      | 90.00 B   | 17.21 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/ember-data-json-api                       | 89.00 B   | 17.02 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data-schemas                       | 89.00 B   | 17.02 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/promise-proxies                           | 85.00 B   | 16.25 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-instance                           | 85.00 B   | 16.25 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data                               | 81.00 B   | 15.49 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/ds-model                                  | 78.00 B   | 14.91 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/utils                                     | 75.00 B   | 14.34 B    | 0.1           | 0.0

Package: @ember-data/record-data
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '25.64 KB' │
│  compressed  │ '4.91 KB'  │
│ % Of Library │   '12.6'   │
└──────────────┴────────────┘
	Module                                                                      | Bytes     | Compressed | % of Package  | % Of Library
	-------------------------------------------------------------------------------------------------------------------------------
	@ember-data/record-data/-private/relationships/state/relationship           | 7.90 KB   | 1.51 KB    | 30.8          | 3.9
	@ember-data/record-data/-private/record-data                                | 7.76 KB   | 1.49 KB    | 30.3          | 3.8
	@ember-data/record-data/-private/relationships/state/belongs-to             | 2.92 KB   | 572.88 B   | 11.4          | 1.4
	@ember-data/record-data/-private/relationships/state/has-many               | 2.67 KB   | 522.96 B   | 10.4          | 1.3
	@ember-data/record-data/-private/ordered-set                                | 1.14 KB   | 223.79 B   | 4.5           | 0.6
	@ember-data/record-data/-private/relationships/state/create                 | 1.05 KB   | 205.24 B   | 4.1           | 0.5
	@ember-data/record-data/-private/index                                      | 1017.00 B | 194.53 B   | 3.9           | 0.5
	@ember-data/record-data/-private/accessors                                  | 475.00 B  | 90.85 B    | 1.8           | 0.2
	@ember-data/record-data/-private/coerce-id                                  | 406.00 B  | 77.66 B    | 1.5           | 0.2
	@ember-data/record-data/-private/normalize-link                             | 249.00 B  | 47.62 B    | 0.9           | 0.1
	@ember-data/record-data/-private/ts-interfaces/relationship-record-data     | 100.00 B  | 19.12 B    | 0.4           | 0.0

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '21.76 KB' │
│  compressed  │ '4.16 KB'  │
│ % Of Library │   '10.7'   │
└──────────────┴────────────┘
	Module                                                     | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                                | 7.12 KB   | 1.36 KB    | 32.7          | 3.5
	@ember-data/serializer/-private/embedded-records-mixin     | 4.30 KB   | 842.01 B   | 19.8          | 2.1
	@ember-data/serializer/json-api                            | 3.72 KB   | 728.01 B   | 17.1          | 1.8
	@ember-data/serializer/rest                                | 2.71 KB   | 531.37 B   | 12.5          | 1.3
	@ember-data/serializer/-private/index                      | 1.18 KB   | 231.44 B   | 5.4           | 0.6
	@ember-data/serializer/-private/transforms/date            | 523.00 B  | 100.03 B   | 2.3           | 0.3
	@ember-data/serializer/-private/transforms/boolean         | 490.00 B  | 93.72 B    | 2.2           | 0.2
	@ember-data/serializer/-private/transforms/number          | 446.00 B  | 85.31 B    | 2.0           | 0.2
	@ember-data/serializer/-private/transforms/string          | 351.00 B  | 67.13 B    | 1.6           | 0.2
	@ember-data/serializer/-private/utils                      | 286.00 B  | 54.70 B    | 1.3           | 0.1
	@ember-data/serializer/index                               | 243.00 B  | 46.48 B    | 1.1           | 0.1
	@ember-data/serializer/-private/transforms/transform       | 242.00 B  | 46.28 B    | 1.1           | 0.1
	@ember-data/serializer/transform                           | 215.00 B  | 41.12 B    | 1.0           | 0.1

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '18.86 KB' │
│  compressed  │ '3.61 KB'  │
│ % Of Library │   '9.3'    │
└──────────────┴────────────┘
	Module                                                                | Bytes     | Compressed | % of Package  | % Of Library
	-------------------------------------------------------------------------------------------------------------------------
	@ember-data/model/-private/model                                      | 6.32 KB   | 1.21 KB    | 33.5          | 3.1
	@ember-data/model/-private/system/many-array                          | 2.39 KB   | 468.06 B   | 12.7          | 1.2
	@ember-data/model/-private/errors                                     | 2.03 KB   | 398.24 B   | 10.8          | 1.0
	@ember-data/model/-private/system/relationships/relationship-meta     | 1.30 KB   | 254.97 B   | 6.9           | 0.6
	@ember-data/model/-private/index                                      | 1.29 KB   | 252.68 B   | 6.8           | 0.6
	@ember-data/model/-private/system/relationships/ext                   | 1.23 KB   | 241.01 B   | 6.5           | 0.6
	@ember-data/model/-private/attr                                       | 724.00 B  | 138.48 B   | 3.7           | 0.3
	@ember-data/model/-private/belongs-to                                 | 663.00 B  | 126.81 B   | 3.4           | 0.3
	@ember-data/model/-private/system/promise-many-array                  | 642.00 B  | 122.80 B   | 3.3           | 0.3
	@ember-data/model/-private/has-many                                   | 626.00 B  | 119.74 B   | 3.2           | 0.3
	@ember-data/model/index                                               | 486.00 B  | 92.96 B    | 2.5           | 0.2
	@ember-data/model/-private/util                                       | 442.00 B  | 84.54 B    | 2.3           | 0.2
	@ember-data/model/-private/system/promise-belongs-to                  | 412.00 B  | 78.80 B    | 2.1           | 0.2
	@ember-data/model/-private/system/model-for-mixin                     | 408.00 B  | 78.04 B    | 2.1           | 0.2

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '18.14 KB' │
│  compressed  │ '3.47 KB'  │
│ % Of Library │   '8.9'    │
└──────────────┴────────────┘
	Module                                                        | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                                      | 8.37 KB   | 1.60 KB    | 46.1          | 4.1
	@ember-data/adapter/error                                     | 1.91 KB   | 374.71 B   | 10.5          | 0.9
	@ember-data/adapter/-private/build-url-mixin                  | 1.82 KB   | 357.12 B   | 10.1          | 0.9
	@ember-data/adapter/index                                     | 1.14 KB   | 222.65 B   | 6.3           | 0.6
	@ember-data/adapter/-private/index                            | 1.03 KB   | 201.99 B   | 5.7           | 0.5
	@ember-data/adapter/json-api                                  | 1.02 KB   | 199.50 B   | 5.6           | 0.5
	@ember-data/adapter/-private/utils/serialize-query-params     | 792.00 B  | 151.49 B   | 4.3           | 0.4
	@ember-data/adapter/-private/utils/determine-body-promise     | 549.00 B  | 105.01 B   | 3.0           | 0.3
	@ember-data/adapter/-private/utils/parse-response-headers     | 480.00 B  | 91.81 B    | 2.6           | 0.2
	@ember-data/adapter/-private/utils/fetch                      | 454.00 B  | 86.84 B    | 2.4           | 0.2
	@ember-data/adapter/-private/utils/serialize-into-hash        | 347.00 B  | 66.37 B    | 1.9           | 0.2
	@ember-data/adapter/-private/utils/continue-on-reject         | 219.00 B  | 41.89 B    | 1.2           | 0.1
	@ember-data/adapter/-private/fastboot-interface               | 76.00 B   | 14.53 B    | 0.4           | 0.0

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '9.50 KB' │
│  compressed  │ '1.82 KB' │
│ % Of Library │   '4.7'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.32 KB   | 455.05 B   | 24.5          | 1.1
	ember-data/-private/index                         | 1.93 KB   | 377.58 B   | 20.3          | 1.0
	ember-data/adapters/errors                        | 1.19 KB   | 232.78 B   | 12.5          | 0.6
	ember-data/setup-container                        | 503.00 B  | 96.21 B    | 5.2           | 0.2
	ember-data/-private/core                          | 321.00 B  | 61.40 B    | 3.3           | 0.2
	ember-data/relationships                          | 318.00 B  | 60.82 B    | 3.3           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 52.41 B    | 2.8           | 0.1
	ember-data/serializers/json-api                   | 251.00 B  | 48.01 B    | 2.6           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 46.86 B    | 2.5           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 46.48 B    | 2.5           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 46.48 B    | 2.5           | 0.1
	ember-data/transform                              | 241.00 B  | 46.09 B    | 2.5           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 45.33 B    | 2.4           | 0.1
	ember-data/serializer                             | 232.00 B  | 44.37 B    | 2.4           | 0.1
	ember-data/adapter                                | 226.00 B  | 43.22 B    | 2.3           | 0.1
	ember-data/model                                  | 222.00 B  | 42.46 B    | 2.3           | 0.1
	ember-data/store                                  | 222.00 B  | 42.46 B    | 2.3           | 0.1
	ember-data/attr                                   | 218.00 B  | 41.69 B    | 2.2           | 0.1
	ember-data/version                                | 162.00 B  | 30.98 B    | 1.7           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.66 KB' │
│  compressed  │ '1.27 KB' │
│ % Of Library │   '3.3'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.88 KB   | 564.08 B   | 43.3          | 1.4
	ember-inflector/lib/system/inflections            | 1.59 KB   | 311.21 B   | 23.9          | 0.8
	ember-inflector/index                             | 473.00 B  | 90.47 B    | 6.9           | 0.2
	ember-inflector/lib/system                        | 471.00 B  | 90.09 B    | 6.9           | 0.2
	ember-inflector/lib/helpers/pluralize             | 373.00 B  | 71.34 B    | 5.5           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 60.82 B    | 4.7           | 0.2
	ember-inflector/lib/utils/make-helper             | 308.00 B  | 58.91 B    | 4.5           | 0.1
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 56.61 B    | 4.3           | 0.1

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.70 KB'  │
│  compressed  │ '528.89 B' │
│ % Of Library │   '1.3'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.21 KB   | 433.44 B   | 82.0          | 1.1
	@ember-data/debug/setup                           | 499.00 B  | 95.44 B    | 18.0          | 0.2

@@ -362,14 +375,21 @@ export default class Relationship {
if (!this._hasSupportForImplicitRelationships(recordData)) {
return;
}
let relationships = recordData._implicitRelationships;
let relationship = relationships[this.inverseKeyForImplicit];
const relationships = implicitRelationshipsFor(recordData);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let if we are following our current style

@@ -516,7 +538,7 @@ export default class Relationship {
const id = guidFor(inverseRecordData);

if (this._hasSupportForImplicitRelationships(inverseRecordData) && seen[id] === undefined) {
const relationship = implicitRelationshipStateFor(inverseRecordData, this.inverseKeyForImplicit);
const relationship = implicitRelationshipStateFor(inverseRecordData, this.inverseKey);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let

if (definition.inverseIsAsync !== undefined) {
return !!definition.inverseIsAsync;
} else {
if (((definition as unknown) as { inverseIsAsync?: boolean }).inverseIsAsync !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats up with multiple casts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though RelationshipDefinition implements RelationshipMeta typescript does not allow us to recast to it without first casting to unknown unless we change the return type of relationshipsDefinitionFor to be a union type. Since this is the only location that we leak our current implementation detail for meta on @ember-data/model it seemed better to leave the return type there alone.

kind: 'belongsTo' | 'hasMany';
type: string;
key: string;
type: string; // related type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@runspired runspired merged commit 65e083d into master Apr 16, 2021
@delete-merged-branch delete-merged-branch bot deleted the runspired/explicit-implicit branch April 16, 2021 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants