Skip to content

build(webpack): reduce production source maps#14890

Open
ShGKme wants to merge 1 commit into
mainfrom
chore/reduce-source-maps
Open

build(webpack): reduce production source maps#14890
ShGKme wants to merge 1 commit into
mainfrom
chore/reduce-source-maps

Conversation

@ShGKme

@ShGKme ShGKme commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

β˜‘οΈ 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
Copy Markdown
Contributor
image

@Antreesy

Antreesy commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

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

ShGKme commented Sep 11, 2025

Copy link
Copy Markdown
Contributor Author

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

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme force-pushed the chore/reduce-source-maps branch from a08e670 to 132fc17 Compare September 11, 2025 12:47
@ShGKme

ShGKme commented Sep 11, 2025

Copy link
Copy Markdown
Contributor Author

Done, but I'll wait for Joas before mergin

@ShGKme

ShGKme commented Sep 15, 2025

Copy link
Copy Markdown
Contributor Author

@nickvergessen What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants