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

Store HarmonyRelease URL properties as string instead of URL #83

Open
kellnerd opened this issue Feb 1, 2025 · 0 comments
Open

Store HarmonyRelease URL properties as string instead of URL #83

kellnerd opened this issue Feb 1, 2025 · 0 comments
Labels
harmonizer Harmonized data representation and processing question Further information is requested

Comments

@kellnerd
Copy link
Owner

kellnerd commented Feb 1, 2025

I am considering to abandon using the URL type for properties of HarmonyRelease in favor of plain strings, which are easier to handle in a number of scenarios:

  • There can be serialization/deserialization issues with dynamic Fresh components: An URL property may silently turn into string properties when they are rendered on the client-side
  • It becomes easier to have a JSON API later when everything is JSON already (which URL is not)
  • No more issues when using structuredClone during merging
  • Smaller test snapshots without redundant URL serializations

The main disadvantes which I see are:

  • Less type safety: A string is not guaranteed to be a valid URL
  • There are cases where we have to construct an URL from the string again to use e.g. the domain
  • It is a breaking change which requires changes to all providers and test snapshots

This should affect external links, API links and image URLs only.

Please let me know if you see any other potential downsides or have alternative ideas.

@kellnerd kellnerd added harmonizer Harmonized data representation and processing question Further information is requested labels Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
harmonizer Harmonized data representation and processing question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant