-
Notifications
You must be signed in to change notification settings - Fork 24
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
✨ Standalone Vite #2530
Merged
Merged
✨ Standalone Vite #2530
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AntoLC
force-pushed
the
feature/anthony/standalone-vite
branch
2 times, most recently
from
December 11, 2023 16:42
254d009
to
50e1dbf
Compare
AntoLC
changed the base branch from
master
to
feature/anthony/optimize-bundle
December 11, 2023 16:46
AntoLC
force-pushed
the
feature/anthony/standalone-vite
branch
11 times, most recently
from
December 15, 2023 16:30
c87edb5
to
842b217
Compare
AntoLC
force-pushed
the
feature/anthony/standalone-vite
branch
from
December 18, 2023 09:13
842b217
to
7825562
Compare
kernicPanel
approved these changes
Dec 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems fine, with a small except for a warning when we run yarn start-site
from src/frontend
:
Plugin: vite:dynamic-import-vars
File: /home/nc/projets/fun/marsha/src/frontend/packages/lib_video/src/utils/conversejs/entry.js:1:0
1 | // This file comes from converse.js github repository
| ^
2 | // This is the entrypoint to load converse headless
3 | // and then use it from window.converse
97f658a: seems to remove the warning |
lunika
approved these changes
Dec 19, 2023
AntoLC
force-pushed
the
feature/anthony/standalone-vite
branch
3 times, most recently
from
December 20, 2023 14:03
b1d7923
to
dd13fdc
Compare
CRA is not maintained anymore, we replace it by vite. This commit replace CRA with the basic setting, we still need to fine tune it to have the same behavior as before.
All our tests are already written in jest, so we will use Jest with Vite. CRA was managing the jest config for us, but now we have to do it ourselves, to do so we need to add a jest config file, and the babel config file. We added some babel plugins to the babel config to make it work with jest and vite.
This commit proxy the url /api to the local backend.
We want the same behavior as with CRA, so we need to adapt the svg loader to return a ReactComponent.
CRA with Jest has a special treatment for SVG files. It uses a Jest transformer to convert SVG files into a svg with some basic information. It is quite usefull to test wich svg is loaded in our tests. In order to have the same behavior in our Vite standalone, we need to add the same transformer. We had to fix another problem, the svg in our app are loaded with a query string. The transformer was not able to handle it. We had to add a babel plugin (babel-plugin-import-remove-resource-query) to remove the query string before the transformer is called.
Absolutes urls are not working with dynamic import, we have to import the translation files with relative paths.
p2p-media-loader-hlsjs uses the "util" module, which is a Node.js module. Vite does not automatically polyfill Node.js modules, so we need to add a polyfill for the "util" module in order to use p2p-media-loader-hlsjs correctly.
ThemeContext is flagged as a "sideEffects" module, Vite seems to have a problem with that, the module is not exported. We change the import of ThemeContext, this way is correctly bundled by Vite.
Vite doesn't support require, so we need to use import instead. We update eslint to allow import.
Add equivalent of __webpack_public_path__ in vite, to allow loading of assets from a CDN on runtime.
In the generics.ts module, importing the module with await import was creating a chunk of the module imported, but Vite was pinpointing that the module was already bundled in the main chunk via index. This commit fixes the warning by importing the module with a standard import, it doesn't have to be a promise anymore.
vtt.js expect VTTRegion to be already defined, but it is not the case, it seems that the Window object didn't have the time to load VTTRegion before vtt.js try to use it. By importing vtt.js in the component, we make sure that Window had the time to load VTTRegion.
Vite was complaining about a circular dependency in lib_components, this commit fixes it.
The vite framework is escaping the variable used in a django template. Instead of using django template, we are doing a replace using a regex on a specfic keyword
Some dependencies were not being installed correctly in lib_markdown, plus these dependencies have some source maps missing that cause warnings during the build. This commit fixes the issue by installing the dependencies correctly, and remove the warnings on missing source maps.
In order to build correctly the stansalone site with vite, we have to set the environment variable VITE_DIR_PROD and VITE_CDN_REPLACE_KEYWORD
When we load a component from a toast.custom, we can't access the intl object, the ancestor tree is lost. We need to pass it down explicitly.
AntoLC
force-pushed
the
feature/anthony/standalone-vite
branch
from
December 21, 2023 15:44
dd13fdc
to
97f6149
Compare
lunika
added a commit
that referenced
this pull request
Jun 24, 2024
Added - Add scaleway storage configuration - Add Peertube pipeline to VOD - Celery task queue - Refactor video S3 deletion - Add thumbnail celery task - Add shared live media celery task - Add timed text track celery task - Add form submission with enter key when entering a classroom - Persist username used on classroom join Changed - Replace CRA by Vite (#2530) - Replace grommet Image and Grid component (#2518) - Optimized apps bundle (#2528) - Launch transcoding through a celery task Fixed - Correctly set startime with filtering medialive logs - Remove non existing fields in PortabilityRequestAdmin - Correctly send xapi statement to a configured LRS - Correctly send xapi video download statements
lunika
added a commit
that referenced
this pull request
Jun 26, 2024
Added - Add scaleway storage configuration - Add Peertube pipeline to VOD - Celery task queue - Refactor video S3 deletion - Add thumbnail celery task - Add shared live media celery task - Add timed text track celery task - Add form submission with enter key when entering a classroom - Persist username used on classroom join Changed - Replace CRA by Vite (#2530) - Replace grommet Image and Grid component (#2518) - Optimized apps bundle (#2528) - Launch transcoding through a celery task Fixed - Correctly set startime with filtering medialive logs - Remove non existing fields in PortabilityRequestAdmin - Correctly send xapi statement to a configured LRS - Correctly send xapi video download statements
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Migrate from CRA to Vite.
CRA is not maintained anymore, better to switch to Vite.
Proposal
Nice stuff
Review
Extra attention on: