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

build: Migrate to Vite #10065

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

build: Migrate to Vite #10065

wants to merge 12 commits into from

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Jul 27, 2023

🚫 Blockers

☑️ Resolves

⏱️ Stats

TODO

🚧 Tasks

  • Replace Webpack with Vite and create basic config and scripts
  • Rename npm package to spreed. it must be the same as appInfo.id
  • Migrate minor unsupported features
    • Remove <docs> in SFC
    • Refactor single-line comments in text interpolation to HTML comments
    • Remove __webpack_nonce__ and __webpack_public_path__
    • Globals without window (seems to work fine)
  • Extract CSS from JS
    • Not really required, but much more optimal and source-maps are broken with injected CSS in Vite
    • Was also possible with Webpack using MiniCssExtractPlugin
  • Fix WebWorker support (virtual background is broken)
    • Add support into upstream?
  • Migrate files-sidebar into a single entrypoint
  • Migrate Leaflet icons
  • Make sure everything still works
    • Calls
      • In Chromium and Firefox
      • In Safari
    • HPB
    • Recordings
    • Integrations
      • Files sidebar
      • Public share sidebar
      • Deck
      • Collections
      • Maps
      • Search
  • Add a bundle analyzer for Vite (Rollup) to replace WebpackBundleAnalyzer
    • Also add to @nextcloud/vite-config?
  • Add Vite support to Talk Desktop

Current issues

  • 🐌 Works slower than Webpack + ESBuild on both development and production builds
  • 🍴 Requires more RAM than Webpack + ESBuild on both development and production builds
  • 🔄️ HMR with npm run serve is not supported anymore
  • 💅 Chunk file names look very random

Follow-ups

  • Get rid of tiny chunks in Vite bundling
  • Use global Talk CSS as a module in bundling
  • Get rid of CSS chunks, bundle to a single CSS per entrypoint

🏁 Checklist

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
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.

Decrease the bundle size and the build time
4 participants