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

[ALT-830] feat: add sdk feature detection object in core #626

Merged
merged 1 commit into from
May 31, 2024

Conversation

ryunsong-contentful
Copy link
Contributor

Purpose

Create sdk feature detection object in core. Then send it as a post message to the ui

@ryunsong-contentful ryunsong-contentful requested review from a team as code owners May 24, 2024 16:40
Copy link

vercel bot commented May 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
experience-builder-test-app ✅ Ready (Inspect) Visit Preview May 29, 2024 4:36pm

@@ -1,6 +1,7 @@
import { useEffect, useRef, useState } from 'react';
import {
doesMismatchMessageSchema,
features,
Copy link
Contributor Author

@ryunsong-contentful ryunsong-contentful May 24, 2024

Choose a reason for hiding this comment

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

i think we should really think carefully about what we name this as this one time decision will have a large impact if we ever want to rename it

Copy link
Member

Choose a reason for hiding this comment

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

I think this is reasonable name. Another slight variation is sdkFeatures, but no strong feelings on it.

@@ -0,0 +1 @@
export const features = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Should a type be defined now to provide guidance on how developers should add features to this object?

Maybe a type like Record<string, boolean | Record<string, boolean> could be a starting point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made it more generic and unopiniated for now so right now it's typed as Record<string | unknown> since technically people can just add objects as well.

Copy link
Member

@elylucas elylucas left a comment

Choose a reason for hiding this comment

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

Overall looks good, left one request change, lmkwyt

Copy link
Member

Choose a reason for hiding this comment

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

I feel like this belongs more in the experiences-sdk-react than in core. There might be a time where we have multiple sdks and they might have diverse features.

@@ -0,0 +1 @@
export const features = {};
Copy link
Member

Choose a reason for hiding this comment

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

A good comment explaining what this file is for would be helpful

@@ -1,6 +1,7 @@
import { useEffect, useRef, useState } from 'react';
import {
doesMismatchMessageSchema,
features,
Copy link
Member

Choose a reason for hiding this comment

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

I think this is reasonable name. Another slight variation is sdkFeatures, but no strong feelings on it.

@anwaar931
Copy link
Contributor

Hey @ryunsong-contentful , Can we get this merged? My ticket is dependent on this one. https://contentful.atlassian.net/browse/SPA-2018
Let me know if this is blocked or we are not moving forward with this.

Thanks

@ryunsong-contentful ryunsong-contentful merged commit e918ab9 into development May 31, 2024
9 checks passed
@ryunsong-contentful ryunsong-contentful deleted the ALT-830 branch May 31, 2024 14: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

4 participants