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

feat!: Default all loaders and mutators to enforcing #256

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wschurman
Copy link
Member

@wschurman wschurman commented Feb 20, 2025

Why

Note: this should probably be released as a new major version, which is 1.0.0 (!).

This addresses the comment on #253:

it'd be a good idea to push out a breaking change to Entity where everything is enforcing by default and you need to call unenforcing() (or withAuthorizationResults())

The reason this is possible now is that after the breaking change from that PR, it is a typescript error breaking change instead of an implicit breaking change to default the loaders/mutations to the enforcing versions.

How

The new CRUD interface for entity will look like:

await TestEntity.creator(vc).setField(...).createAsync();
await TestEntity.creatorWithAuthorizationResults(vc).setField(...).updateAsync();

await TestEntity.updater(entity).setField(...).createAsync();
await TestEntity.updaterWithAuthorizationResults(entity).setField(...).updateAsync();

await TestEntity.deleter(entity).deleteAsync();
await TestEntity.deleterWithAuthorizationResults(entity).deleteAsync();

await TestEntity.loader(vc).getByIDAsync(id);
await TestEntity.loaderWithAuthorizationResults(vc).getByIDAsync(id);

await entity.associationLoader().loadAssociatedEntityAsync(...);
await entity.associationLoaderWithAuthorizationResults().loadAssociatedEntityAsync(...);

Test Plan

Full test coverage.

@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from 3c5172c to da53893 Compare February 20, 2025 20:19
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d63ddd6) to head (d3a4a60).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #256   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           80        80           
  Lines         2053      2070   +17     
  Branches       277       282    +5     
=========================================
+ Hits          2053      2070   +17     
Flag Coverage Δ
integration 100.00% <100.00%> (ø)
unittest 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wschurman wschurman changed the base branch from @wschurman/02-19-chore_switch_barreling_to_ctix to graphite-base/256 February 20, 2025 21:14
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from da53893 to 9189649 Compare February 20, 2025 21:14
@wschurman wschurman changed the base branch from graphite-base/256 to @wschurman/02-20-feat_add_enforcing_entity_association_loader February 20, 2025 21:14
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from 9189649 to 49742c0 Compare February 20, 2025 21:50
@wschurman wschurman marked this pull request as ready for review February 20, 2025 22:04
@wschurman wschurman requested review from ide and quinlanj February 20, 2025 22:04
@wschurman wschurman changed the base branch from @wschurman/02-20-feat_add_enforcing_entity_association_loader to graphite-base/256 February 24, 2025 03:08
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from 49742c0 to 4742ba8 Compare February 24, 2025 03:08
@wschurman wschurman changed the base branch from graphite-base/256 to @wschurman/02-23-feat_create_codemod_for_v0.39.0_-_v0.40.0 February 24, 2025 03:08
@wschurman wschurman force-pushed the @wschurman/02-23-feat_create_codemod_for_v0.39.0_-_v0.40.0 branch from 01b2606 to 7be217a Compare February 24, 2025 03:16
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from 4742ba8 to 32ccd3d Compare February 24, 2025 03:16
@wschurman wschurman force-pushed the @wschurman/02-23-feat_create_codemod_for_v0.39.0_-_v0.40.0 branch 2 times, most recently from 857a69b to 828daef Compare February 24, 2025 03:36
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from 32ccd3d to e072e65 Compare February 24, 2025 03:36
@wschurman wschurman changed the base branch from @wschurman/02-23-feat_create_codemod_for_v0.39.0_-_v0.40.0 to graphite-base/256 February 24, 2025 04:19
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from e072e65 to 7bfa3cb Compare February 24, 2025 04:19
@wschurman wschurman changed the base branch from graphite-base/256 to main February 24, 2025 04:19
Copy link
Member Author

Will land this once v0.40.0 is stabilized and has been out for a little while. Will also write a codemod in the @expo/entity-codemod package added in #259.

@wschurman wschurman changed the base branch from main to graphite-base/256 February 24, 2025 16:53
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from 7bfa3cb to b211f6b Compare February 24, 2025 16:53
@wschurman wschurman changed the base branch from graphite-base/256 to @wschurman/02-23-feat_create_codemod_for_v0.39.0_-_v0.40.0 February 24, 2025 16:53
@wschurman wschurman changed the base branch from @wschurman/02-23-feat_create_codemod_for_v0.39.0_-_v0.40.0 to graphite-base/256 February 24, 2025 20:09
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from b211f6b to 7ca3847 Compare February 24, 2025 20:09
@wschurman wschurman changed the base branch from graphite-base/256 to main February 24, 2025 20:10
@wschurman wschurman force-pushed the @wschurman/02-20-feat_default_all_loaders_and_mutators_to_enforcing branch from 7ca3847 to d3a4a60 Compare February 24, 2025 20:10
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.

3 participants