0xdevalias / chatgpt-source-watch

Analyzing the evolution of ChatGPT's codebase through time with curated archives and scripts
https://github.com/0xdevalias/chatgpt-source-watch/blob/main/CHANGELOG.md
Other
269 stars 15 forks source link

Explore creating a 'reverse engineered' records.json / stats.json file from a webpack build #9

Open 0xdevalias opened 4 months ago

0xdevalias commented 4 months ago

This is an idea I've had in passing a few times, but keep forgetting to document it:

I'm not 100% sure if this would be useful, or partially useful, but I think I am thinking of it tangentially in relation to things like:

0xdevalias commented 4 months ago

Even more tangentially related to this, I've pondered how much we could 're-construct' the files necessary to use tools like bundle analyzer, without having access to the original source (or if there would even be any benefit to trying to do so):

My gut feel is that we probably can figure out most of what we need for it; we probably just can't give accurate sizes for the original pre-minified code, etc; and the module names/etc might not be mappable to their originals unless we have module identification type features (see https://github.com/pionxzh/wakaru/issues/41)

pionxzh commented 4 months ago

You want a re-constructed stat.json or records.json which can be put back into an analyzer plugin, right? This can be useful to understand the shape and code size distribution in chunks.

I just did some research on it. I feel it's possible to generate stats.json, but it requires deep understanding about the bundling details of webpack. And the module graph would be a must for us to do this.

This is the sample that I get on google. https://gist.github.com/TheLarkInn/577d6a8896b4553d4b2865fe1c8db7fa

0xdevalias commented 4 months ago

You want a re-constructed stat.json or records.json which can be put back into an analyzer plugin, right?

@pionxzh nods yeah, that was what I was originally thinking about; and then I was thinking that there might also be some crossover with the parts used for this that could align with figuring how to identify module changes/etc.

Here's another search that should pull up a bunch more samples: