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

feat: support local embeds #2024

Merged
merged 2 commits into from
Jan 15, 2025
Merged

feat: support local embeds #2024

merged 2 commits into from
Jan 15, 2025

Conversation

chdeskur
Copy link
Contributor

This PR enables to reference locally-hosted files

Before:
Screenshot 2025-01-15 at 12 59 02 PM

After:
Screenshot 2025-01-15 at 1 00 02 PM

@chdeskur chdeskur requested a review from abvthecity as a code owner January 15, 2025 18:00
Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
rbac.ferndocs.com ❌ Failed (Inspect) Jan 15, 2025 6:00pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
fern-shell ⬜️ Ignored (Inspect) Jan 15, 2025 6:00pm

@chdeskur chdeskur had a problem deploying to Preview - app.buildwithfern.com January 15, 2025 18:00 — with GitHub Actions Error
@chdeskur chdeskur had a problem deploying to Preview - app-dev.buildwithfern.com January 15, 2025 18:00 — with GitHub Actions Error
@chdeskur chdeskur enabled auto-merge (squash) January 15, 2025 18:03
Copy link
Member

@dsinghvi dsinghvi left a comment

Choose a reason for hiding this comment

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

so sick, we should document this and add to the changelog cc @kgowru

export const Embed: FC<ComponentProps<"embed">> = ({ src, ...rest }) => {
const files = useAtomValue(FILES_ATOM);

const fernEmbedSrc = useMemo((): DocsV1Read.File_ | undefined => {
Copy link
Contributor

Choose a reason for hiding this comment

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

probably good to make this a utility function and share it across the codebase. i imagine we'll do this more.

strong: Strong,
};

const ALIASED_HTML_COMPONENTS = {
Image,
Embed,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add one for video since you're here?

@chdeskur
Copy link
Contributor Author

+1 to both, will scope to another PR

Copy link

📦 Next.js Bundle Analysis for fern-platform-monorepo

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

PR Preview

@chdeskur chdeskur merged commit 5c43336 into main Jan 15, 2025
16 of 17 checks passed
@chdeskur chdeskur deleted the chdeskur/embed branch January 15, 2025 18:09
Copy link

Playwright test results

passed  94 passed
flaky  5 flaky
skipped  2 skipped

Details

stats  101 tests across 9 suites
duration  1 minute, 38 seconds
commit  61b5ccd

Flaky tests

chromium › skew-protection/index.test.ts › should contain ?dpl= or x-deployment-id header on all scripts and prefetch requests
chromium › smoke/favicon.spec.ts › Check if favicon exists and URL does not return 404 for docs.anterior.com
chromium › smoke/favicon.spec.ts › Check if favicon exists and URL does not return 404 for docs.cohere.com
chromium › smoke/favicon.spec.ts › Check if favicon exists and URL does not return 404 for docs.schematichq.com
chromium › smoke/favicon.spec.ts › Check if favicon exists and URL does not return 404 for fern.assemblyai.com

Skipped tests

chromium › posthog.spec.ts › Posthog loads successfully
chromium › websockets/websocket.spec.ts › websocket test

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.

3 participants