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(FaceLandmarker): default basePath aligned with tasks-vision package version #1510

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abernier
Copy link
Member

@abernier abernier commented Jun 13, 2023

Why / What

In FaceLandmarkerDefaults.basePath the version was until now hardcoded: 0.10.0

basePath: 'https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.0/wasm',

This PR lets use @rollup/plugin-replace(compatible with Vite) to make it dynamic, with the version of the installed @mediapipe/tasks-vision package

Checklist

  • Documentation updated (example)
  • Storybook entry added (example)
  • Ready to be merged

@vercel
Copy link

vercel bot commented Jun 13, 2023

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

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 9:17am

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 13, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 046b888:

Sandbox Source
aged-sun-44m5z7 Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

@abernier abernier changed the title fix(FaceLandmarker): default CDN basePath in the same version as the … fix(FaceLandmarker): default basePath aligned with tasks-vision package Jun 13, 2023
@@ -13,7 +13,7 @@ type FaceLandmarkerProps = {
}

export const FaceLandmarkerDefaults = {
basePath: 'https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.0/wasm',
basePath: `https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${process.env.ROLLUP_REPLACE_MEDIAPIPE_TASKS_VISION_VERSION}/wasm`,
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the purpose replacement of this PR


export default {
plugins: [glslify()],
plugins: [replace(replacements), glslify()],
Copy link
Member Author

Choose a reason for hiding this comment

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

@rollup/plugin-replace is compatible with Vite

@abernier abernier marked this pull request as ready for review June 13, 2023 22:46
@abernier
Copy link
Member Author

let you review @CodyJasonBennett since it touches rollup.config.js and is related to @mediapipe/tasks-vision bump from #1509

@abernier abernier changed the title fix(FaceLandmarker): default basePath aligned with tasks-vision package fix(FaceLandmarker): default basePath aligned with tasks-vision package version Jun 13, 2023
@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Jun 13, 2023

This relies on pinning the version so we can't use loose ranges via ^ and ~ since they get resolved by users' package managers. We currently do this since they publish RCs in a weird way without pinning, but it prevents this from working dynamically.

@abernier
Copy link
Member Author

abernier commented Jun 14, 2023

This relies on pinning the version so we can't use loose ranges via ^ and ~ since they get resolved by users' package managers. We currently do this since they publish RCs in a weird way without pinning, but it prevents this from working dynamically.

In my mind we can use any ranges since it reads the version directly from node_modules/@mediapipe/tasks-vision/package.json.version which is necessarily resolved by the package manager.

I've checked with our currently defined 0.10.2-rc2 that the files were here at the dynamically printed basePath https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${"0.10.2-rc2"}/wasm

@seungwoohong
Copy link

Screen Shot 2023-11-02 at 10 24 29 AM

I have this issue.
does this have anything to do with this error?

Copy link

Thank you for your work on this pull request! We’re marking this PR as stale to encourage a final push to bring it across the finish line.

Any update, comment, or change to the PR will automatically remove the stale label so it stays active in our workflow.

If you need any help, don’t hesitate to connect with us on Discord for feedback and support. This PR will close automatically soon if there’s no further activity, but we’re here to help if you’re interested in getting it merged. Thank you for your contribution!

@github-actions github-actions bot added the Stale Inactive issue label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Inactive issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants