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

Removed createSchemaBridge #718

Merged
merged 3 commits into from
May 6, 2020
Merged

Removed createSchemaBridge #718

merged 3 commits into from
May 6, 2020

Conversation

radekmie
Copy link
Contributor

@radekmie radekmie commented May 2, 2020

As mentioned in #716, new lifecycle APIs made efficient automatic bridge creation harder (impossible without additional API). This change removes createSchemaBridge completely, meaning that:

  • There's no need for bridge in BaseForm state.
  • There's no need for check on Bridge and subclasses.
  • Anyone who passed SimpleSchema instance to schema prop of BaseForm have to manually create bridge instance.

My motivation is not only the performance gain (strict equality check instead of almost no-op createSchemaBridge checks) and removal of a state property (which was always a copy of props.schema for GraphQL and JSON schemas) but also simplification of the public API - the transformation of a schema to a bridge is now explicit.

@radekmie radekmie added the Type: Feature New features and feature requests label May 2, 2020
@radekmie radekmie added this to the v3 milestone May 2, 2020
@radekmie radekmie requested review from kestarumper and Monteth May 2, 2020 19:39
@codecov
Copy link

codecov bot commented May 2, 2020

Codecov Report

Merging #718 into v3 will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v3     #718      +/-   ##
==========================================
- Coverage   98.02%   97.99%   -0.03%     
==========================================
  Files         162      159       -3     
  Lines        1668     1645      -23     
  Branches      602      598       -4     
==========================================
- Hits         1635     1612      -23     
  Misses          8        8              
  Partials       25       25              
Impacted Files Coverage Δ
...kages/uniforms-bridge-graphql/src/GraphQLBridge.ts 100.00% <ø> (ø)
...niforms-bridge-json-schema/src/JSONSchemaBridge.ts 98.43% <ø> (-0.02%) ⬇️
...es/uniforms-bridge-simple-schema-2/src/register.ts 100.00% <ø> (ø)
...rms-bridge-simple-schema/src/SimpleSchemaBridge.ts 100.00% <ø> (ø)
...ages/uniforms-bridge-simple-schema/src/register.ts 100.00% <ø> (ø)
packages/uniforms/src/Bridge.ts 100.00% <ø> (ø)
...-bridge-simple-schema-2/src/SimpleSchema2Bridge.ts 100.00% <100.00%> (ø)
packages/uniforms/src/BaseForm.tsx 98.11% <100.00%> (-0.04%) ⬇️
packages/uniforms/src/ValidatedForm.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 716f0bd...826edac. Read the comment docs.

@radekmie radekmie merged commit 7c02b49 into v3 May 6, 2020
@radekmie radekmie deleted the v3-removed-createschemabridge branch May 6, 2020 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants