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: v4 #223

Merged
merged 3 commits into from
Apr 8, 2024
Merged

feat: v4 #223

merged 3 commits into from
Apr 8, 2024

Conversation

kyle-ssg
Copy link
Member

@kyle-ssg kyle-ssg commented Apr 5, 2024

Breaking changes

  • Init will now reject if:
    • No environment ID is provider
    • Fetch fails and there's no cache (Init resolves on cache)
    • There's no cache/defaults and preventFetch is true
  • The boolean properties traitsChange and flagsChanged are now a string[] of changed keys or null. This reduces breaking changes since falsey and truthy checks will still behave as before.

Other changes

  • Init is (finally) async/await
  • Init code is reduced by pulling out isolated functions
  • Added tests around init promises
  • Organised util files

Corresponding docs

@@ -1,8 +1,8 @@
import React, { FC } from 'react';
import { render, screen, waitFor } from '@testing-library/react';
import { FlagsmithProvider, useFlags, useFlagsmithLoading } from '../lib/flagsmith/react';
import { defaultState, environmentID, getFlagsmith, identityState } from './test-constants';
import removeIds from './util/remove-ids';
import { defaultState, environmentID, getFlagsmith, identityState, testIdentity } from './test-constants';
Copy link
Contributor

Choose a reason for hiding this comment

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

environmentID is no longer used.

Copy link
Contributor

@novakzaballa novakzaballa left a comment

Choose a reason for hiding this comment

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

From the code perspective, it looks good. I also tested with the examples and everything works as expected.

@kyle-ssg kyle-ssg merged commit 6253e7e into main Apr 8, 2024
1 check passed
@kyle-ssg kyle-ssg deleted the feat/v4 branch April 8, 2024 07:52
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.

None yet

2 participants