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

fix[gen1][core] ENG-7515 add query.id when hitting content API for symbols #3752

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

clyde-builderio
Copy link
Contributor

Description

In Gen1 SDK, when content API is hit for Symbols, it does not render symbols properly

Jira ticket
https://builder-io.atlassian.net/browse/ENG-7515

Loom
https://www.loom.com/share/90d3b6e317bb493e98ad418ac2f0b7a0

@clyde-builderio clyde-builderio requested a review from a team as a code owner November 20, 2024 06:04
@clyde-builderio clyde-builderio requested review from mrkoreye and removed request for a team November 20, 2024 06:04
Copy link

changeset-bot bot commented Nov 20, 2024

⚠️ No Changeset found

Latest commit: 691495f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines 2636 to 2639
if (apiEndpoint === 'content' && queue[0].model === 'symbol') {
queryParams['query.id'] = queue[0].entry;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

We should set this in Symbol.tsx instead. I think it can go in here:

options={{
...(!this.isEditingThisSymbol && {
key: builderComponentKey,
noEditorUpdates: true,
}),
}}
codegen={!!content?.data?.blocksJs}

The reason for that is because the model name might be something other than symbol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change is working as expected. Here is a loom with a demo of the changes https://www.loom.com/share/083d6711f94048ce8b88c514c71012e4

Copy link
Contributor

@samijaber samijaber left a comment

Choose a reason for hiding this comment

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

the query param is in a condition it shouldn't be in

@@ -160,6 +160,9 @@ class SymbolComponent extends React.Component<PropsWithChildren<SymbolProps>> {
...(!this.isEditingThisSymbol && {
key: builderComponentKey,
noEditorUpdates: true,
query: {
Copy link
Contributor

Choose a reason for hiding this comment

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

this query param should not be condition in editingThisSymbol. it should always be provided

Copy link
Contributor

Choose a reason for hiding this comment

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

also, this query param should only be added when the entry value exists AND when the apiEndpoint value is "content"

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