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: add support for loading admin extensions from the source #10975

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

thetutlage
Copy link
Contributor

Fixes: FRMW-2874

Loading admin extensions from the source helps in achieving HMR with Vite for the extensions.

Loading admin extensions from the source helps in achieving HMR with
Vite for the extensions
@thetutlage thetutlage requested a review from a team as a code owner January 15, 2025 12:42
Copy link

vercel bot commented Jan 15, 2025

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

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 5:16am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Jan 16, 2025 5:16am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Jan 16, 2025 5:16am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Jan 16, 2025 5:16am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jan 16, 2025 5:16am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Jan 16, 2025 5:16am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Jan 16, 2025 5:16am

Copy link

changeset-bot bot commented Jan 15, 2025

🦋 Changeset detected

Latest commit: 39f4bc7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 65 packages
Name Type
@medusajs/medusa Patch
@medusajs/framework Patch
@medusajs/types Patch
integration-tests-http Patch
@medusajs/dashboard Patch
@medusajs/test-utils Patch
@medusajs/api-key Patch
@medusajs/auth Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/cart Patch
@medusajs/currency Patch
@medusajs/customer Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/file Patch
@medusajs/fulfillment Patch
@medusajs/index Patch
@medusajs/inventory Patch
@medusajs/link-modules Patch
@medusajs/locking Patch
@medusajs/notification Patch
@medusajs/order Patch
@medusajs/payment Patch
@medusajs/pricing Patch
@medusajs/product Patch
@medusajs/promotion Patch
@medusajs/region Patch
@medusajs/sales-channel Patch
@medusajs/stock-location Patch
@medusajs/store Patch
@medusajs/tax Patch
@medusajs/user Patch
@medusajs/workflow-engine-inmemory Patch
@medusajs/workflow-engine-redis Patch
@medusajs/auth-emailpass Patch
@medusajs/auth-github Patch
@medusajs/auth-google Patch
@medusajs/file-local Patch
@medusajs/file-s3 Patch
@medusajs/fulfillment-manual Patch
@medusajs/locking-postgres Patch
@medusajs/locking-redis Patch
@medusajs/notification-local Patch
@medusajs/notification-sendgrid Patch
@medusajs/payment-stripe Patch
@medusajs/core-flows Patch
@medusajs/js-sdk Patch
@medusajs/modules-sdk Patch
@medusajs/orchestration Patch
@medusajs/utils Patch
@medusajs/workflows-sdk Patch
@medusajs/cli Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci Patch
@medusajs/telemetry Patch
@medusajs/admin-bundler Patch
@medusajs/admin-sdk Patch
@medusajs/admin-shared Patch
@medusajs/admin-vite-plugin Patch
@medusajs/icons Patch
@medusajs/toolbox Patch
@medusajs/ui-preset Patch
create-medusa-app Patch
medusa-dev-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@kasperkristensen kasperkristensen left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -440,6 +463,7 @@ export class Compiler {
* a file has changed.
*/
async developPluginBackend(onFileChange?: () => void) {
await this.#createPluginOptionsFile()
Copy link
Contributor

Choose a reason for hiding this comment

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

@thetutlage just making sure: Can we guarantee that this file will never end up in the final build of the plugin which is published to NPM, or would it be safer to clean this up when the dev process is killed? If it ends up in the final NPM package, admin extensions would fail to load for the plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you mean. Ideally, I expect the users to run npm run build at the time of publishing the plugin to npm. And that command will perform a cleanup + build and this file will never part of the published file.

@thetutlage thetutlage merged commit c75678d into develop Jan 16, 2025
23 checks passed
This was referenced Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants