Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

feat: enable user profile embed on external site #9851

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

Conversation

eddiejaoude
Copy link
Member

@eddiejaoude eddiejaoude commented Nov 29, 2023

Fixes Issue

closes #9100

Deploying PR to Preview environment #9500

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Screenshot 2023-11-29 at 08 10 41

Note to reviewers

babblebey and others added 4 commits November 29, 2023 07:30
* feat: add `@vercel/og` package

* feat: boilerplate embed endpoint on `edge` runtime

* feat: integrate `embed` endpoint into `[username]` route SSR

* feat: add `satori`; remove `@vercel/og` package

* feat: add embed `Profile` component

* feat: integrate embed `Profile` with `satori` in `embed` endpoint

* chore: move `Youtube` to `embeds/internal` dir

* feat: boilerplate embed url on user profile

* fix: nits

* feat: add `twemoji` util function

* feat: implement `twemoji` in `loadAdditiionalAsset` prop

* feat: add embed url field to profile share modal

* chore: modify theme fallback value

* fix(build): generate new `package-lock`

* Update components/embeds/external/Profile.js

* refactor: merge repeated part in components/user/UserProfile.js

Suggestion by @a0m0rajab

Co-authored-by: Abdurrahman Rajab <rajab-2@windowslive.com>

* fix: remove redundant return

---------

Co-authored-by: Eddie Jaoude <eddie@jaoudestudios.com>
Co-authored-by: Abdurrahman Rajab <rajab-2@windowslive.com>
@eddiejaoude eddiejaoude changed the title Feat babblebey embed profile feat: enable user profile embed on external site Nov 29, 2023
@github-actions github-actions bot added CI/CD dependencies Pull requests that update a dependency file 📖 docs Documentation pages labels Nov 29, 2023
@eddiejaoude
Copy link
Member Author

eddiejaoude commented Nov 29, 2023

Having some challenges with the middleware and custom domains (deployed to Preview environment https://biodrop-preview.vercel.app/api/profiles/eddiejaoude/embed?theme=default)

  • when visiting the embed url, it thinks it is a custom domain
  • fonts not found
  [Error: ENOENT: no such file or directory, open '/home/runner/work/BioDrop/BioDrop/public/Inter-Regular.ttf'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/runner/work/BioDrop/BioDrop/public/Inter-Regular.ttf'
}
  MissingStaticPage [Error]: Failed to load static file for page: /en/500 ENOENT: no such file or directory, open '/var/task/.next/server/pages/en/500.html'
    at /var/task/node_modules/next/dist/server/require.js:102:19
    at async loadComponentsImpl (/var/task/node_modules/next/dist/server/load-components.js:59:26)
    at async NextNodeServer.findPageComponentsImpl (/var/task/node_modules/next/dist/server/next-server.js:669:36)
    at async NextNodeServer.renderErrorToResponseImpl (/var/task/node_modules/next/dist/server/base-server.js:2042:30)
    at async pipe.req.req (/var/task/node_modules/next/dist/server/base-server.js:1982:30)
    at async NextNodeServer.pipeImpl (/var/task/node_modules/next/dist/server/base-server.js:902:25)
    at async NextNodeServer.handleCatchallRenderRequest (/var/task/node_modules/next/dist/server/next-server.js:281:21)
    at async NextNodeServer.runImpl (/var/task/node_modules/next/dist/server/base-server.js:887:9)
    at async NextNodeServer.handleRequestImpl (/var/task/node_modules/next/dist/server/base-server.js:824:20)
[Error: ENOENT: no such file or directory, open '/home/runner/work/BioDrop/BioDrop/public/Inter-Regular.ttf'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/runner/work/BioDrop/BioDrop/public/Inter-Regular.ttf'
}
Error: Runtime exited with error: exit status 1
Runtime.ExitError

const inter = await fs.readFile(
path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
"../../../../public",
Copy link
Contributor

Choose a reason for hiding this comment

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

fonts not found

In regards to the file not being found, I want to assume it due to the variation in environments folder location once the next build down for production.

I think we can stick to our current scope.... This path.dirname(fileURLToPath(import.meta.url)) resolves to our current file location, maybe we can just move the font folder into thesame location where this file lives... that way we can do away ../../../../public which might seem unpredictable to using fonts in its place as second args,

So the new set up can look like

api/profiles/[username]

- embed.js

fonts

- Inter-Regular.ttf

- Inter-Bold.ttf

@babblebey
Copy link
Contributor

when visiting the embed url, it thinks it is a custom domain

I will try look into this sometime too!

Yo @a0m0rajab, get in here 😉

@a0m0rajab
Copy link

Thanks! @babblebey sure will check this next week or the week after, I feel like to finish this https://github.com/open-sauced/ai/issues/291first then jump to this project, or I might have a one extended day for coding to try this lol.

@SaraJaoude SaraJaoude added the issue linked Pull Request has issue linked label Dec 11, 2023
@babblebey
Copy link
Contributor

babblebey commented Mar 20, 2024

Hey @eddiejaoude, found this is still pending 🫣. I cannot exactly reproduce the error you're experiencing. Let's pair on this sometime and work with the preview environment when you're free.

This feature should be shipped already 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI/CD dependencies Pull requests that update a dependency file 📖 docs Documentation pages issue linked Pull Request has issue linked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Embed BioDrop Profile on external site
4 participants