ember-cli-bundle-analyzer icon indicating copy to clipboard operation
ember-cli-bundle-analyzer copied to clipboard

Refactor to use sourcemaps for analysis

Open simonihmig opened this issue 6 years ago • 1 comments

This is basically an Ember CLI addon providing a middleware that wraps the existing analyzer functionality of https://github.com/stefanpenner/broccoli-concat-analyser, which itself is coupled to the stats output functionality of broccoli-concat. This comes with some problems:

  • it currently does not work correctly with ember-auto-import (https://github.com/stefanpenner/broccoli-concat-analyser/issues/34)
  • any modern new build/packager pipeline (aka embroider) will (assumingly/most likely) not use broccoli-concat and thus make this cease to work at all!?

The only way forward I can think of is to make this work independently of the underlying bundler is by depending on sourcemaps only to analyze the bundle output. This could be implemented by making this basically a wrapper around https://github.com/danvk/source-map-explorer, eventually with a nicer (the current) frontend output.

Before I go down the rabbit hole here and invest some time, I would like to summon the experts in this field, namely @stefanpenner and @ef4, to share their thoughts, if time permits! 🙏😀

simonihmig avatar Jun 01 '19 14:06 simonihmig

I think sourcemap approach makes sense, currently we do not have a "Fast, file only" sourcemap configuration for broccoli-concat, this results in either 1) slow high fidelity maps 2) no maps. Due to this, the original approach was taken.

That being said, It shouldn't be very hard to add "file only" sourcemaps to broccoli-concat. What i mean by "file only" is that, they do not care about the interior mappings of a file, merely the file boundaries when concat occurs.

stefanpenner avatar Jun 06 '19 16:06 stefanpenner