Skip to content

Conversation

@ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Apr 17, 2025

☑️ Resolves

Reduce /js directory size on production from 170 MB to 90 MB

  • Application size in the /apps/spreed folder is about 210 MB, with 170 MB (80%) js/ folder
  • It includes .map files with 120 MB (70% of js/, 57% of /apps/spreed)
  • Getting rid of SourceMaps completely would make bug reporting much more complicated
  • However, we can use less expensive source maps with only original file names and lines, but not entire source content
  • This makes .map 3 times smaller, or /apps/spreed 60% smaller
Stuff 🏚️ Before 🏡 After
App folder 210 MB 🟦🟦🟦🟦🟦 130 MB 🟦🟦🟦
JS folder 170 MB 🟦🟦🟦🟦 90 MB 🟦🟦🟦
.js.map 120 MB 🟦🟦🟦 40 MB 🟦

🏁 Checklist

  • 🌏 Tested with different browsers / clients:
    • Chromium (Chrome / Edge / Opera / Brave)
    • Firefox
    • Safari
    • Talk Desktop
    • Not risky to browser differences / client
  • 🖌️ Design was reviewed, approved or inspired by the design team
  • ⛑️ Tests are included or not possible
  • 📗 User documentation in https://github.com/nextcloud/documentation/tree/master/user_manual/talk has been updated or is not required

@ShGKme ShGKme added this to the 🪺 Next Major (32) milestone Apr 17, 2025
@ShGKme ShGKme self-assigned this Apr 17, 2025
@ShGKme ShGKme force-pushed the chore/reduce-source-maps branch from b4d6639 to a08e670 Compare September 8, 2025 20:25
@ShGKme ShGKme marked this pull request as ready for review September 8, 2025 20:25
@DorraJaouad
Copy link
Contributor

image

@Antreesy
Copy link
Contributor

Antreesy commented Sep 9, 2025

Fixable with $csp->addAllowedScriptDomain("'unsafe-eval'"); adding to CSPListener.php. Need to check if this is fine to modify it for all cases, or only with xdebug flag

But I'm not sure about prod sourcemaps, is this expected?
2025-09-09_10h50_30

@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 11, 2025

We can also use cheap-source-map for development wich has the same source maps quality but slower rebuild in watch mode.

@ShGKme ShGKme force-pushed the chore/reduce-source-maps branch from a08e670 to 132fc17 Compare September 11, 2025 12:47
@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 11, 2025

Done, but I'll wait for Joas before mergin

@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 15, 2025

@nickvergessen What do you think?

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.

5 participants