Skip to content

DEVREL-3672 et al: Component props#35

Open
tim-webflow wants to merge 4 commits intomainfrom
DEVREL-3672-et-al-component-props
Open

DEVREL-3672 et al: Component props#35
tim-webflow wants to merge 4 commits intomainfrom
DEVREL-3672-et-al-component-props

Conversation

@tim-webflow
Copy link
Copy Markdown
Collaborator

Examples for https://github.com/webflow/openapi-internal/pull/761

  • DEVREL-2759: resetAllProps()
  • DEVREL-2758: setProps()
  • DEVREL-2757: getResolvedProps()
  • DEVREL-2756: getProps()

@tim-webflow tim-webflow self-assigned this Apr 6, 2026
@tim-webflow tim-webflow requested a review from jamesmosier April 6, 2026 19:25
Copy link
Copy Markdown

@jamesmosier jamesmosier left a comment

Choose a reason for hiding this comment

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

Did some testing and it looks good! Just a couple small changes that would be good 🙏

if (typeof prop.value === 'object' && prop.value !== null && 'sourceType' in prop.value) {
console.log(`${prop.propId}: bound to ${(prop.value as { sourceType: string }).sourceType}`);
} else {
console.log(`${prop.propId}: ${prop.value}${prop.hasOverride ? ' (overridden)' : ''}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
console.log(`${prop.propId}: ${prop.value}${prop.hasOverride ? ' (overridden)' : ''}`);
console.log(`${prop.propId}: ${JSON.stringify(prop.value)}${prop.hasOverride ? ' (overridden)' : ''}`);

Some values are object, so we should be able to stringify it to output the object.

Before:
Image

After:
Image

const resolvedProps = await instanceEl.getResolvedProps();

for (const prop of resolvedProps) {
console.log(`${prop.propId}: ${prop.value}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
console.log(`${prop.propId}: ${prop.value}`);
console.log(`${prop.propId}: ${JSON.stringify(prop.value)}`);

Similar here, we can output the object to make it readable.

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.

2 participants