intro.js icon indicating copy to clipboard operation
intro.js copied to clipboard

npm package has source files minified

Open ryders opened this issue 3 years ago • 8 comments

Description

It appears that all source files are minified. I'm not a packaging expert, however looking at a few other packages installed in my node_module/ folder, and most have the source in src/ as not minified, and the source in dist/ as minified.

Expected Behavior

I don't expect all .js to be minified, specially when it comes to debugging and trying to figure things myself, out prior to raising issues. I'm currently experiencing a problem where .removeHints() doesn't remove anything.. and I have no avenue to trying to understand whether anything I've done is impacting this.

Actual Behavior

When debugging, if you're stepping into any intro.js functions, it's essentially impossible to figure out what's happening.

Errors and Screenshots (optional)

Not Applicable. Well.. I've included one for your viewing pleasure! Screen Shot 2022-05-20 at 12 32 33

Clearly -- I cannot step into intro.js: Screen Shot 2022-05-20 at 12 39 32

Comparatively -- I can step into Angular' HttpClient class with no trouble Screen Shot 2022-05-20 at 12 41 40

Example (recommended)

cat node_modules/intro.js/intro.js```

## Environment (optional)
"intro.js": "^5.1.0"

ryders avatar May 20 '22 19:05 ryders

btw -- I was able to prettyprint (using, eg. beautifier.io) and manually save the file, but this goes beyond good practices for npm packages... and minified also means function names are changed, so this is pretty cryptic to debug with..

ryders avatar May 20 '22 19:05 ryders

Hitting the same issue. As a workaround, I commended out these lines: https://github.com/usablica/intro.js/blob/55bac403388c5ee00d6c0139386d1687d9063877/rollup.config.js#L40 https://github.com/usablica/intro.js/blob/55bac403388c5ee00d6c0139386d1687d9063877/rollup.config.js#L46 and added minimize: false to the postcss of the non-minimized ones in the same file. Then I built and copied the non-minimized ones. This isn't a full fix as it breaks the minimized versions.

bazubii avatar Jun 01 '22 16:06 bazubii

Is it possible to use the sourcemaps? Intro.js provides sourcemaps for all minified files.

afshinm avatar Jul 10 '22 09:07 afshinm

I had exactly the same question in my mind when I installed the npm package. The main folder as well as the 'minified' folder within both contain minified identical files (why?), making the minified folder and its contents completely obsolete. To debug the npm package you basically have to clone the repo.

sammuell avatar Jul 13 '22 08:07 sammuell

@sammuell The reason we have the same file in the minified folder is for backward compatibility. We should at some point remove that folder though. Were you able to use the sourcemaps provided in the package?

afshinm avatar Jul 13 '22 18:07 afshinm

Were you able to use the sourcemaps provided in the package?

No, I ended up cloning the repo locally instead of using the npm package.

sammuell avatar Jul 14 '22 09:07 sammuell

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 20 '22 17:09 stale[bot]

@afshinm can you confirm files are no longer minified? All I see here is a discussion of workarounds and alternatives, not addressing the root problem where good practices suggestthatminified JavaScript shouldn't be found in a file that is not named .min

Feel free to close but I don't have any evidence this was addressed.

ryders avatar Sep 21 '22 19:09 ryders

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 22 '22 18:11 stale[bot]

@afshinm can you confirm files are no longer minified? All I see here is a discussion of workarounds and alternatives, not addressing the root problem where good practices suggestthatminified JavaScript shouldn't be found in a file that is not named .min

Feel free to close but I don't have any evidence this was addressed.

ryders avatar Nov 26 '22 19:11 ryders

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 02 '23 02:02 stale[bot]