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

docs: Adding a rejected alternative to OEP-65 for Vite module federation #619

Conversation

davidjoy
Copy link
Contributor

This PR adds another rejected alternative to OEP-65. We investigated using Vite for module federation and found it wasn't a viable alternative to Webpack module federation.

@openedx-webhooks
Copy link

Thanks for the pull request, @davidjoy!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @sarina. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 31, 2024

Another related alternative we considered was to write our own module federation implementation using Vite for its build. This option significantly means there's even less documentation and no community support, and Vite lacks support excluding dependencies from its output bundle, similar to how `Webpack externals <https://webpack.js.org/configuration/externals/>`_ works. We would need a mechanism like this to support a custom implementation.

For all these reasons, we've rejected a Vite-based implementation of module federation. If, at a later date, a more viable Vite implementation of module federation is available, we might strongly consider migrating to Vite to be a great way of improving the performance and developer experience of our frontend builds.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we say "If, at a later date, a more viable Vite implementation of module federation is available or we no longer have runtime remote discovery as a hard requirement, we might strongly consider migrating to Vite..." ?


Unfortunately, both of these implementations have limitations and drawbacks that make them unsuitable as a way of implementing runtime module loading for Open edX:

- We consider runtime remote discovery to be a required feature of our module federation implementation. This is the ability to register remotes - servers which host modules - at runtime, not just at build time. We do not want to rebuild our "hosts" - whether shell or another MFE - when we want to add a new remote. We want to be able to get our remote configuration at runtime and register remotes with the system when the application is running.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the first mention of the term "remote discovery" in the document. I think it'd be nice to have the description of this requirement (including using the term) earlier in the document (possibly in the "Capability: Runtime Module Loading" section).

Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for taking a serious look into it.

- Define runtime remote discovery.
- Specify that we could revisit Vite if runtime remote discovery is no longer a hard requirement.
@davidjoy
Copy link
Contributor Author

davidjoy commented Aug 1, 2024

@bradenmacdonald and @brian-smith-tcril, great suggestions, I've added both. Thanks!

@brian-smith-tcril brian-smith-tcril merged commit de81df2 into openedx:master Aug 1, 2024
5 checks passed
@openedx-webhooks
Copy link

@davidjoy 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@davidjoy davidjoy deleted the djoy/oep-65-vite-rejected-alternative branch August 1, 2024 17:12
davidjoy added a commit to davidjoy/open-edx-proposals that referenced this pull request Aug 28, 2024
…ion (openedx#619)

* docs: Adding a rejected alternative to OEP-65 for Vite module federation

* docs: review feedback of vite rejected alternative

- Define runtime remote discovery.
- Specify that we could revisit Vite if runtime remote discovery is no longer a hard requirement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants