-
Notifications
You must be signed in to change notification settings - Fork 15
feat: jsx variables #899
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
feat: jsx variables #899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and it's working nicely locally; would approve save for one concern.
processor/transform/index.ts
Outdated
| export { readmeComponentsTransformer, readmeToMdx, injectComponents, variables }; | ||
|
|
||
| export default [calloutTransformer, codeTabsTransfromer, embedTransformer, gemojiTransformer]; | ||
| export default [calloutTransformer, codeTabsTransfromer, embedTransformer, gemojiTransformer, variables]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this export be called variablesTransformer if only for consistency?
docs/variable-tests.md
Outdated
| It does not render in code blocks: | ||
|
|
||
| ```js | ||
| const xyz = "<Variable variable="defvar" />"; | ||
| ``` | ||
| {user.defvar} | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these vars need to be usable within code blocks; I've seen customers use this functionality to construct customized copyable snippets! (It used to be that you'd escape them– something like \<<defvar\>> –if you wanted to show the string literally.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hate this snap
|
@rafegoldberg approve me? |
trishaprile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!
This PR was released!🚀 Changes included in v6.75.0-beta.57 |

🧰 Changes
Uses jsx variables for user variables.
The first pass at variables was very simple:
This replaces with regular old jsx interpolated variables:
Much nicer!
🧬 QA & Testing