-
Notifications
You must be signed in to change notification settings - Fork 1
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: render Preview inside iframe, inject built Tailwind CSS instead of runtime. #385
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
864a454
to
4a86916
Compare
c700501
to
663da21
Compare
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.
lgtm, clarification regarding the iframe. i've also noticed (while testing on local) that clicking on the hamburger menu expands the entire nav bar out to the whole document (and obscures the view), which doesn't happen on uat
i don't think expanding the nav bar out is a blocker to merge, but i caveat that we should definitely fix this soon because it's functionally not what users expect, and leads to a less than ideal experience.
another point of difference, though, is that now our iframe
uses the embedded document's width
as the width to bound the inner element. this means that now, we display a hamburger menu (at least on my mac's screen) whereas previously we displayed the menu. i think functionally this is a win but it does mean that we also need to have a sliding drawer for users to actually see their site in the desktop view.
apps/studio/src/features/editing-experience/components/PreviewIframe.tsx
Outdated
Show resolved
Hide resolved
apps/studio/src/features/editing-experience/components/PreviewIframe.tsx
Show resolved
Hide resolved
apps/studio/src/features/editing-experience/components/PreviewIframe.tsx
Show resolved
Hide resolved
apps/studio/src/features/editing-experience/components/PreviewIframe.tsx
Show resolved
Hide resolved
cc @sehyunidaaa any opinions on sliding drawer ui/ux? |
4a86916
to
1bc41c7
Compare
663da21
to
bcfab3e
Compare
TL;DR
Added a new build script for Tailwind CSS and introduced
react-frame-component
to the Studio application.This was intended to allow for isolation of preview in regards to the rest of the application (able to set specific breakpoints, etc). 90% of the way there, but click events and scroll locks still trigger on root for some reason. Mitigated with an effect but might cause more inconvenience in the future. Should still be good enough.
TODO (In future PRs):
What changed?
build:preview-tw
inpackage.json
to compile Tailwind CSS.preview-tw.css
generated by Tailwind CSS.react-frame-component
package todependencies
.PreviewIframe
component utilizingreact-frame-component
.PreviewIframe
into the page editor.MobileNavMenu
components in theNavbar
.How to test?
npm install
to install the new dependencyreact-frame-component
.npm run build:preview-tw
to compile the Tailwind CSS file.Why make this change?
To improve the styling and component structure of the Studio application, and to provide a better development experience with Tailwind CSS and iframe previews.