7
Teknas
66d

I published my first open source angular module 🚀
Show me some love
https://npmjs.com/package/...

Comments
  • 1
    Upvote, but "tiny ~88kb" wtf do you do that requires that much data?
  • 0
    @jespersh
    well the compressed version is 16kb 🤷‍♂️
    I'm storing a colours array for randomly assigning background colours. Maybe that's the culprit.
  • 4
    Hi!

    I cannot test the library, but I have few suggestions in general. They are meant in good intent, even if they sound harsh:

    - Choose an open source license, too. Otherwise your library is absolutely not usable for anyone, because no right of usage is given.
    - Add proper commit messages - "patch", "patch", "patch" might not be perfect. I made this mistake at my first library, too.
    - Clean the repository. I am no JS developer, but in the repository I have no idea where to look for the actual code (am I right with /projects/text-placeholder/src/lib/text-placeholder.directive.ts for the main file and dist/* is the JavaScript output from Typescript? And what is in /src?). Clean it up, distribution files and compilation results aren't usually included in the repository.
    - Where's the 88kB coming from? If the file I mentioned previously is the only file of code and this leads to 88kB output, something is wrong. This is not lightweight.
  • 0
    @sbiewald
    hey thanks a lot for the suggestions.

    I'll definately add the license

    About the patch thing, I got a little lazy and automated the entire deploy process including the git push.

    What I publish to npm is under /dist
    Wouldn't it be weird if what is published to npm itself is not available in the repository ? That's why I purposefully override the default .gitignore and removed the dist folder. If any js developer can tell me what is the proper way to do this, that would be great.

    About the size thing, will have to check it out. In your opinion, what's lightweight ?
  • 0
    @Teknas Lightweight is relative :)

    About the automated pushes to GitHub: Don't. Without proper commit messages, git has little use. Otherwise you could just publish your source code and a bunch of diffs.

    The default .gitignores by GitHub are usually fine, but I would search for a larger project and look what they use.
  • 1
    @sbiewald I searched around, the massive size is actually due to the build process, the module is rendered in different compatibility levels and published. This is also considered to be the best practice based on angular guidelines.

    When the end user uses this inside another application, treeshaking will ensure only the bare minimal stuff gets in.
  • 0
    @Teknas That's fine, I guess.
Your Job Suck?
Get a Better Job
Add Comment