prismicio / prismic-types

Type definitions for Prismic content, models, and APIs
https://prismic.io/docs/technologies/javascript
Apache License 2.0
11 stars 4 forks source link

fix: prevent compatibility issues with enum types #18

Closed lihbr closed 2 years ago

lihbr commented 3 years ago

Types of changes

Description

Changed the enum to a looser {} as const object for RichTextNodeType. This should prevent compatibility issues when relying on different versions of @prismicio/types.

@angeloashmore, should we proceed the same way with LinkType/EmbedType? Not sure those were impacted the same way πŸ€”

Will do the rolling out to kits using RichTextNodeType once merged πŸ‘Œ

Resolves: #16

Checklist:

🐎

codecov-commenter commented 3 years ago

Codecov Report

Merging #18 (92dfa3b) into master (b17ae84) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #18   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           59        40   -19     
=========================================
- Hits            59        40   -19     
Impacted Files Coverage Ξ”
src/fields.ts 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 b17ae84...92dfa3b. Read the comment docs.

angeloashmore commented 3 years ago

These changes look good to me πŸ‘

@angeloashmore, should we proceed the same way with LinkType/EmbedType? Not sure those were impacted the same way πŸ€”

For consistency, I think we should change them to objects as well. I have not encountered issues with LinkType or EmbedType in the same way I did with RichTextNodeType, however. Up to you!

lihbr commented 2 years ago

I still need to update other enum types, will do next week!

lihbr commented 2 years ago

Should be good to go!

angeloashmore commented 2 years ago

Awesome! I just converted the Custom Type enums as well.

angeloashmore commented 2 years ago

Published in v0.1.18 πŸŽ‰

lihbr commented 2 years ago

Great! Didn't do it for CTs as I wasn't sure of a benefit for them, but well, it's done 🀷