Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-coats-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
Copy link
Member

Choose a reason for hiding this comment

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

patch?

Suggested change
'@primer/react': minor
'@primer/react': patch

Copy link
Member Author

Choose a reason for hiding this comment

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

@siddharthkp my thinking for picking minor was that this change seemed like it was adding functionality where a type was broadended to accept more values. Right now in our versioning doc we have that as a minor over at: https://github.com/primer/react/blob/main/contributor-docs/versioning.md#the-type-of-a-prop-is-broadened

Let me know if this seems more like a bug fix though or if it'd be worth talking about updating the version doc 👍

---

Broaden feature flag type for experimental FeatureFlags to accept undefined
7 changes: 5 additions & 2 deletions packages/react/src/FeatureFlags/FeatureFlagScope.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type FeatureFlags = {
[key: string]: boolean
[key: string]: boolean | undefined
}

export class FeatureFlagScope {
Expand All @@ -24,7 +24,10 @@ export class FeatureFlagScope {
flags: Map<string, boolean>

constructor(flags: FeatureFlags = {}) {
this.flags = new Map(Object.entries(flags))
this.flags = new Map()
for (const [key, value] of Object.entries(flags)) {
this.flags.set(key, value ?? false)
}
}

/**
Expand Down