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

Login updates from 4.1 to 3.12. #1456

Merged
merged 32 commits into from
Jan 9, 2025
Merged

Conversation

NikoHelle
Copy link
Contributor

Description

Cherry-picked login updates from 4.1 (development)

Related Issue

  • hds-2524
  • hds-2535 (both branches)
  • hds-2563 (not select v4)
  • hds-2539
  • hds-2553

Motivation and Context

How Has This Been Tested?

Demos:

Links to demos are in the comments

Screenshots (if appropriate):

Add to changelog

  • [x ] Added needed line to changelog

If items are added directly to the module array, the array size increases and same modules are added twice on second render.
Memoize array in Login.stories and merge 3 useMemos to one in LoginContext
…f beacon is re-created

In a scenario where external modules are used and the component is created multiple times, the listeners are set only once in the modules.

This happens in StrictMode.

On the second storeBeacon call the listeners in dedicated beacon are not added back and old ones are not removed.

The list of listeners must be kept and disposers must be called.

Now listeners are added again.

Listeners added after a beacon is created are not stored, because those are logically added when second beacon is created - as in first run.
Select exported old ones and Login was missing
ApiToken renewal/update/removal can happen regardless of on-going queries. The renewal should also timeout.

This util will track tokens, store them and timeout rewals.

The code logic is copied from graphqlModule.
Main function of this module is to automatically append tokens to query headers and wait for on-going apiToken renewals when queries start.
If imports point to apollo/client/core, the apollo/client is not detected to be the one in package.json.

Then it is bundled in to the hds-js.
…ntext

The import in apolloClientModule.ts cannot be changed, so all bundled modules must be listed in allowedExternals.

They are then bundled, but there is no fix.
Similar to ApolloClientModule and GraphQLModule but appends api tokens to fetch requests.
The render process could be too fast for Date.now() to change
Copy link

github-actions bot commented Dec 23, 2024

Test Results

1 tests   1 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 5127989.

♻️ This comment has been updated with latest results.

Copy link

Preview found from hds-demo docs/preview_1456

Demos

Docs
Core Storybook
React Storybook

Copy link
Contributor

@mrTuomoK mrTuomoK left a comment

Choose a reason for hiding this comment

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

Good job

Copy link
Contributor

@timwessman timwessman left a comment

Choose a reason for hiding this comment

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

Good!

@timwessman timwessman merged commit 83de650 into release-3.12.0 Jan 9, 2025
10 checks passed
@timwessman timwessman deleted the release-3.12.0-wip branch January 9, 2025 11:53
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