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: adding vitest and initial tagging function [TOL-909] #5

Merged
merged 5 commits into from
Feb 23, 2023

Conversation

aodhagan-cf
Copy link
Collaborator

@aodhagan-cf aodhagan-cf commented Feb 23, 2023

Adding initial tagging functionality

@aodhagan-cf aodhagan-cf requested a review from a team February 23, 2023 14:34
Copy link
Contributor

@YvesRijckaert YvesRijckaert left a comment

Choose a reason for hiding this comment

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

Small question

locale,
});
expect(result).toStrictEqual({
'data-contentful-field-id': `${entryId}:${fieldId}:${locale}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking out loud here, what if the user has a ':' inside of the fieldId? Won't this cause issues to extract the variables from the string?
We had a similar issue with the path in Compose before

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah defo a good point! I didn't want to reintroduce the 👺 or what we had before. Can you think of a more sensible delimiter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess another way to do it could be

'data-contentful-field-id': fieldId,
'data-contentful-entry-id': entryId,
'data-contentful-locale': locale`,

then no need for the delimiting

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a delimiter that is less likely to appear within the variable values? Like the pipe symbol (|) or tilde symbol (~)? Not sure...

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes I like your approach 👏

Copy link
Contributor

Choose a reason for hiding this comment

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

Just one note:
That could be resolve to a lot of markup on the website and bloat the HTML response (on server-side-rendering).
I guess we should give some best practices to customers to only render the tags on a preview system so they don't affect the performance of their website?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@chrishelgert yeah makes sense!

@aodhagan-cf aodhagan-cf merged commit 510e96f into main Feb 23, 2023
@aodhagan-cf aodhagan-cf deleted the feat/TOL-909 branch February 23, 2023 15:05
@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 1.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants