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(url-state-provider): new way of encoding and decoding query string #712

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

Conversation

taymoor89
Copy link
Contributor

Summary

This PR implements a new encode and decode function to persist a javascript object to the query string and parsing query string back to the same javascript object.

This whole idea of this solution has been verified by Esther and Stefan Majewsky(who needs to craft query string in this new way).

Changes Made

  • The new encode and decode methods that are exported as encodeV2 and decodeV2 are created inside v2 directory to keep existing code intact.

Related Issues

Testing Instructions

  1. npm i
  2. npm run test

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.

@taymoor89 taymoor89 requested a review from a team as a code owner January 10, 2025 14:27
Copy link

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 5f07139

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudoperators/juno-url-state-provider Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@taymoor89 taymoor89 force-pushed the taimoor-url-state-provider-v2 branch from 86e2df5 to e5ad04e Compare January 10, 2025 14:28
@taymoor89 taymoor89 force-pushed the taimoor-url-state-provider-v2 branch from e5ad04e to 5f07139 Compare January 10, 2025 14:37
@taymoor89 taymoor89 self-assigned this Jan 10, 2025
@taymoor89 taymoor89 added the package All tasks related to package under packages/ label Jan 10, 2025
@@ -324,3 +324,5 @@ export {
decode,
encode,
}

export { encode as encodeV2, decode as decodeV2 } from "./v2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question:
I understand why you did this in the context of a minor update. But why not make it a new major version instead and have the encode and decode exports be the V2 versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I did not created a major version just yet is because the new solution would run alongside the existing one so technically this is not a break change at the moment but after all apps are fully converted to the new URL structure then we can remove the old solution and release a major version as a breaking change and rename encodeV2, decodeV2 exports.
Moreover if we release a new major version we’ll have to make sure that any important change in the previous version(e.g vulnerabilities fix) will have to be separately released to the previous version as patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package All tasks related to package under packages/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants