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

fix: RecordState cleanup, drop requireESM and node12 #8042

Merged
merged 6 commits into from
Jul 23, 2022

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Jul 22, 2022

Mostly ports test work from #7971 to help simplify review of it.

Surfaces a few areas where RecordState is likely not calculating the same value as InternalModel[flag] / InternalModel.currentState[flag].

TODO We should consider RecordState being brought into core, it currently seems we need at least a subset of it for managing request-making determination (see flags on InternalModel). Hopefully as those codepaths get cleaned up we can do-away with that need so lets not jump at it.

Additionally drops node12 as we no longer need to support it and the scenario had started failing.
Fixes the asset-size checker.

resolves #7379
resolves #8043

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ bug This PR primarily fixes a reported issue labels Jul 22, 2022
@github-actions
Copy link

github-actions bot commented Jul 22, 2022

Asset Size Report for bfaa859

Modern Builds

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

Warnings

⚠️ The uncompressed size of the package @ember-data/store has increased by +76.03 KB.
⚠️ The uncompressed size of the package @ember-data/model has increased by +30.63 KB.
⚠️ The uncompressed size of the package @ember-data/record-data has increased by +24.08 KB.
⚠️ The uncompressed size of the package @ember-data/serializer has increased by +19.77 KB.
⚠️ The uncompressed size of the package @ember-data/adapter has increased by +15.71 KB.
⚠️ The uncompressed size of the package ember-data has increased by +8.87 KB.
⚠️ The uncompressed size of the package ember-inflector has increased by +6.67 KB.
⚠️ The uncompressed size of the package @ember-data/debug has increased by +2.85 KB.

Changeset


EmberData +184.62 KB +184.62 KB (+38.95 KB +38.94 KB compressed)
    @ember-data/store +76.03 KB +76.03 KB (+16.04 KB +16.04 KB compressed)
        @ember-data/store/-private +75.12 KB +75.12 KB (+15.85 KB +15.85 KB compressed)
        @ember-data/store/index +936.0 B +936.0 B (+197.45 B +197.45 B compressed)
    @ember-data/model +30.63 KB +30.63 KB (+6.46 KB +6.46 KB compressed)
        @ember-data/model/-private +30.16 KB +30.16 KB (+6.36 KB +6.36 KB compressed)
        @ember-data/model/index +486.0 B +486.0 B (+102.52 B +102.52 B compressed)
    @ember-data/record-data +24.08 KB +24.08 KB (+5.08 KB +5.08 KB compressed)
        @ember-data/record-data/-private +24.08 KB +24.08 KB (+5.08 KB +5.08 KB compressed)
    @ember-data/serializer +19.77 KB +19.77 KB (+4.17 KB +4.17 KB compressed)
        @ember-data/serializer/json +7.22 KB +7.22 KB (+1.52 KB +1.52 KB compressed)
        @ember-data/serializer/-private +5.53 KB +5.53 KB (+1.17 KB +1.17 KB compressed)
        @ember-data/serializer/json-api +3.71 KB +3.71 KB (+801.4 B +801.39 B compressed)
        @ember-data/serializer/rest +2.84 KB +2.84 KB (+614.5 B +614.49 B compressed)
        @ember-data/serializer/index +258.0 B +258.0 B (+54.42 B +54.42 B compressed)
        @ember-data/serializer/transform +215.0 B +215.0 B (+45.35 B +45.35 B compressed)
    @ember-data/adapter +15.71 KB +15.71 KB (+3.32 KB +3.32 KB compressed)
        @ember-data/adapter/rest +7.88 KB +7.88 KB (+1.66 KB +1.66 KB compressed)
        @ember-data/adapter/-private +3.77 KB +3.77 KB (+814.91 B +814.89 B compressed)
        @ember-data/adapter/error +1.99 KB +1.99 KB (+430.13 B +430.12 B compressed)
        @ember-data/adapter/index +1.04 KB +1.04 KB (+223.82 B +223.82 B compressed)
        @ember-data/adapter/json-api +1.03 KB +1.03 KB (+223.39 B +223.39 B compressed)
    ember-data +8.87 KB +8.87 KB (+1.87 KB +1.87 KB compressed)
        ember-data/index +2.17 KB +2.17 KB (+468.52 B +468.51 B compressed)
        ember-data/-private +1.9 KB +1.9 KB (+409.88 B +409.87 B compressed)
        ember-data/adapters/errors +1.19 KB +1.19 KB (+256.72 B +256.72 B compressed)
        ember-data/setup-container +368.0 B +368.0 B (+77.63 B +77.63 B compressed)
        ember-data/relationships +318.0 B +318.0 B (+67.08 B +67.08 B compressed)
        ember-data/serializers/embedded-records-mixin +274.0 B +274.0 B (+57.8 B +57.8 B compressed)
        ember-data/serializers/json-api +251.0 B +251.0 B (+52.94 B +52.95 B compressed)
        ember-data/adapters/json-api +245.0 B +245.0 B (+51.68 B +51.68 B compressed)
        ember-data/serializers/json +243.0 B +243.0 B (+51.26 B +51.26 B compressed)
        ember-data/serializers/rest +243.0 B +243.0 B (+51.26 B +51.26 B compressed)
        ember-data/transform +241.0 B +241.0 B (+50.83 B +50.84 B compressed)
        ember-data/adapters/rest +237.0 B +237.0 B (+49.99 B +49.99 B compressed)
        ember-data/serializer +232.0 B +232.0 B (+48.94 B +48.94 B compressed)
        ember-data/adapter +226.0 B +226.0 B (+47.67 B +47.67 B compressed)
        ember-data/model +222.0 B +222.0 B (+46.83 B +46.83 B compressed)
        ember-data/store +222.0 B +222.0 B (+46.83 B +46.83 B compressed)
        ember-data/attr +218.0 B +218.0 B (+45.98 B +45.99 B compressed)
        ember-data/version +161.0 B +161.0 B (+33.96 B +33.96 B compressed)
    ember-inflector +6.67 KB +6.67 KB (+1.41 KB +1.41 KB compressed)
        ember-inflector/lib/system/inflector +2.96 KB +2.96 KB (+640.02 B +640.01 B compressed)
        ember-inflector/lib/system/inflections +1.59 KB +1.59 KB (+343.21 B +343.21 B compressed)
        ember-inflector/lib/system +471.0 B +471.0 B (+99.35 B +99.36 B compressed)
        ember-inflector/index +379.0 B +379.0 B (+79.95 B +79.95 B compressed)
        ember-inflector/lib/helpers/pluralize +369.0 B +369.0 B (+77.84 B +77.84 B compressed)
        ember-inflector/lib/utils/make-helper +332.0 B +332.0 B (+70.03 B +70.03 B compressed)
        ember-inflector/lib/system/string +318.0 B +318.0 B (+67.08 B +67.08 B compressed)
        ember-inflector/lib/helpers/singularize +296.0 B +296.0 B (+62.44 B +62.44 B compressed)
    @ember-data/debug +2.85 KB +2.85 KB (+616.19 B +616.18 B compressed)
        @ember-data/debug/index +2.36 KB +2.36 KB (+509.65 B +509.65 B compressed)
        @ember-data/debug/setup +505.0 B +505.0 B (+106.53 B +106.53 B compressed)

Full Asset Analysis (Modern)

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


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

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '76.03 KB' │
│  compressed  │ '16.04 KB' │
│ % Of Library │   '41.2'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/-private                        | 75.12 KB  | 15.85 KB   | 98.8          | 40.7
	@ember-data/store/index                           | 936.00 B  | 197.45 B   | 1.2           | 0.5

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '30.63 KB' │
│  compressed  │ '6.46 KB'  │
│ % Of Library │   '16.6'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/-private                        | 30.16 KB  | 6.36 KB    | 98.5          | 16.3
	@ember-data/model/index                           | 486.00 B  | 102.52 B   | 1.5           | 0.3

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

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '19.77 KB' │
│  compressed  │ '4.17 KB'  │
│ % Of Library │   '10.7'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                       | 7.22 KB   | 1.52 KB    | 36.5          | 3.9
	@ember-data/serializer/-private                   | 5.53 KB   | 1.17 KB    | 28.0          | 3.0
	@ember-data/serializer/json-api                   | 3.71 KB   | 801.40 B   | 18.8          | 2.0
	@ember-data/serializer/rest                       | 2.84 KB   | 614.50 B   | 14.4          | 1.5
	@ember-data/serializer/index                      | 258.00 B  | 54.42 B    | 1.3           | 0.1
	@ember-data/serializer/transform                  | 215.00 B  | 45.35 B    | 1.1           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '15.71 KB' │
│  compressed  │ '3.32 KB'  │
│ % Of Library │   '8.5'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                          | 7.88 KB   | 1.66 KB    | 50.1          | 4.3
	@ember-data/adapter/-private                      | 3.77 KB   | 814.91 B   | 24.0          | 2.0
	@ember-data/adapter/error                         | 1.99 KB   | 430.13 B   | 12.7          | 1.1
	@ember-data/adapter/index                         | 1.04 KB   | 223.82 B   | 6.6           | 0.6
	@ember-data/adapter/json-api                      | 1.03 KB   | 223.39 B   | 6.6           | 0.6

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '8.87 KB' │
│  compressed  │ '1.87 KB' │
│ % Of Library │   '4.8'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.17 KB   | 468.52 B   | 24.5          | 1.2
	ember-data/-private                               | 1.90 KB   | 409.88 B   | 21.4          | 1.0
	ember-data/adapters/errors                        | 1.19 KB   | 256.72 B   | 13.4          | 0.6
	ember-data/setup-container                        | 368.00 B  | 77.63 B    | 4.1           | 0.2
	ember-data/relationships                          | 318.00 B  | 67.08 B    | 3.5           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 57.80 B    | 3.0           | 0.1
	ember-data/serializers/json-api                   | 251.00 B  | 52.94 B    | 2.8           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 51.68 B    | 2.7           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 51.26 B    | 2.7           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 51.26 B    | 2.7           | 0.1
	ember-data/transform                              | 241.00 B  | 50.83 B    | 2.7           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 49.99 B    | 2.6           | 0.1
	ember-data/serializer                             | 232.00 B  | 48.94 B    | 2.6           | 0.1
	ember-data/adapter                                | 226.00 B  | 47.67 B    | 2.5           | 0.1
	ember-data/model                                  | 222.00 B  | 46.83 B    | 2.4           | 0.1
	ember-data/store                                  | 222.00 B  | 46.83 B    | 2.4           | 0.1
	ember-data/attr                                   | 218.00 B  | 45.98 B    | 2.4           | 0.1
	ember-data/version                                | 161.00 B  | 33.96 B    | 1.8           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.67 KB' │
│  compressed  │ '1.41 KB' │
│ % Of Library │   '3.6'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.96 KB   | 640.02 B   | 44.4          | 1.6
	ember-inflector/lib/system/inflections            | 1.59 KB   | 343.21 B   | 23.8          | 0.9
	ember-inflector/lib/system                        | 471.00 B  | 99.35 B    | 6.9           | 0.2
	ember-inflector/index                             | 379.00 B  | 79.95 B    | 5.6           | 0.2
	ember-inflector/lib/helpers/pluralize             | 369.00 B  | 77.84 B    | 5.4           | 0.2
	ember-inflector/lib/utils/make-helper             | 332.00 B  | 70.03 B    | 4.9           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 67.08 B    | 4.7           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 62.44 B    | 4.3           | 0.2

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.85 KB'  │
│  compressed  │ '616.19 B' │
│ % Of Library │   '1.5'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.36 KB   | 509.65 B   | 82.7          | 1.3
	@ember-data/debug/setup                           | 505.00 B  | 106.53 B   | 17.3          | 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     │
└────────────┴──────────┘

@runspired runspired changed the title fix: minor tweaks to convert tests to testing RecordState instead of the StateMachine fix: RecordState cleanup, drop requireESM and node12 Jul 23, 2022
@runspired runspired merged commit b115541 into master Jul 23, 2022
@delete-merged-branch delete-merged-branch bot deleted the runspired/record-state-cleanup branch July 23, 2022 01:45
@github-actions
Copy link

Performance Report for bfaa859

Scenario - materialization: ☑️ Performance is stable

☑️ duration
phase no difference [-28ms to 33ms]
☑️ Phase [navigationStart] => [start-find-all]
phase no difference [-19ms to 12ms]
☑️ Phase [start-find-all] => [start-materialization]
phase no difference [-14ms to 21ms]
☑️ Phase [start-materialization] => [end-materialization]
phase no difference [-19ms to 10ms]
☑️ Phase [end-materialization] => [Test End]
phase no difference [-3ms to 10ms]

Scenario - unload: ☑️ Performance is stable

☑️ duration
phase no difference [-40ms to 16ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-21ms to 20ms]
☑️ Phase [start-push-payload] => [start-unload-records]
phase no difference [-14ms to 24ms]
✅ Phase [start-unload-records] => [end-unload-records]
phase estimated improvement -12ms [-20ms to -4ms] OR -1.81% [-3.15% to -0.58%]
✅ Phase [end-unload-records] => [Test End]
phase estimated improvement -3ms [-4ms to -1ms] OR -2.7% [-4.81% to -0.57%]

Scenario - destroy: ☑️ Performance is stable

☑️ duration
phase no difference [-48ms to 18ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-15ms to 23ms]
☑️ Phase [start-push-payload] => [start-destroy-records]
phase no difference [-36ms to 3ms]
☑️ Phase [start-destroy-records] => [end-destroy-records]
phase no difference [-20ms to 10ms]
⚠️ Phase [end-destroy-records] => [Test End]
phase estimated regression +3ms [1ms to 5ms] OR +3.7% [1.22% to 5.99%]

Scenario - add-children: ☑️ Performance is stable

☑️ duration
phase no difference [-3ms to 40ms]
☑️ Phase [navigationStart] => [start-push-initial-payload]
phase no difference [-8ms to 29ms]
☑️ Phase [start-push-initial-payload] => [start-push-update-payload]
phase no difference [-7ms to 13ms]
☑️ Phase [start-push-update-payload] => [end-push-update-payload]
phase no difference [-3ms to 4ms]
☑️ Phase [end-push-update-payload] => [Test End]
phase no difference [0ms to 5ms]

Scenario - unused-relationships: ☑️ Performance is stable

☑️ duration
phase no difference [-49ms to 7ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-27ms to 11ms]
☑️ Phase [start-push-payload] => [end-push-payload]
phase no difference [-31ms to 12ms]
☑️ Phase [end-push-payload] => [Test End]
phase no difference [-4ms to 3ms]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 canary PR is targeting canary (default) 🏷️ bug This PR primarily fixes a reported issue
Projects
None yet
1 participant