ngx-markdown icon indicating copy to clipboard operation
ngx-markdown copied to clipboard

marked should be peerDependency

Open FirstVertex opened this issue 3 years ago • 1 comments

In our app we use both ngx-markdown and marked (plain version).

When we import plain marked, it makes marked.esm.js appear 2 times in our bundle. Please move the "marked" to peerDependency of your package.json.

See here the screen shot from webpack-bundle-analyzer image

FirstVertex avatar Aug 22 '22 16:08 FirstVertex

You might consider moving all deps to peerDeps. lib should not have deps.

FirstVertex avatar Aug 22 '22 16:08 FirstVertex

This is something I am considering but as it is a breaking change, it will require to wait for the next major release planned for Angular 15.

jfcere avatar Oct 14 '22 00:10 jfcere

hi @jfcere ! thanks for the replay! I don't understand why this would be considered breaking. Anybody who would update to latest patch version would also automatically be prompted to install any peer dep, no code change would be necessary.

FirstVertex avatar Oct 14 '22 13:10 FirstVertex

It is a breaking change because it means that anybody who update the library would need to do manual changes to add dependencies to their package.json because they would no longer be automatically included.

Some people use tools in their CI, such as Renovate, that automatically update dependencies... they would be impacted by that change.

jfcere avatar Oct 15 '22 12:10 jfcere

Thanks for the PR, I moved all dependencies to peer dependencies in a beta version that is only available if manually updated in anticipation of the next major version that I will officially release at the same time as Angular 15.

You can update ngx-markdown using the command below and of course, install your required peer dependencies following the updated installation section of the README.md.

npm install [email protected]

jfcere avatar Oct 23 '22 00:10 jfcere

@jfcere I see marked is still a dep in version 15. i thought this was being moved to peerDep as discussed

FirstVertex avatar Apr 03 '23 15:04 FirstVertex

@FirstVertex Out of curiosity, where do you see marked as a dependency as per version 15? https://unpkg.com/browse/[email protected]/package.json

jfcere avatar Apr 03 '23 15:04 jfcere

I see it here https://github.com/jfcere/ngx-markdown/blob/master/package.json I apologize if that was a wrong assumption that this package.json corresponds to the one in the published package.

FirstVertex avatar Apr 03 '23 18:04 FirstVertex

Yeah no, the package.json for the published package is in the lib folder here: https://github.com/jfcere/ngx-markdown/blob/master/lib/package.json

jfcere avatar Apr 03 '23 18:04 jfcere