TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: A new, declarative spin on client-side package management

5 pointsby fileartsabout 11 years ago

1 comment

fileartsabout 11 years ago
You might ask why this is &#x27;declarative&#x27; and that would be a good question. Here is why I consider this declarative:<p>Your dependencies are declared in the markup by special data attributes added to script and link[rel=stylesheet] tags. The dependencies get parsed and the markup can be automatically updated to the best available set of packages that satisfy these dependencies. What is neat is that the system will resolve dependencies as deep as needed and will insert the relevant script and link tags in the correct order.<p>Why is this different?<p>Most package managers focus on the offline development world. This scheme was designed specifically for Plunker [1] which is an online front-end development tool. This means that there are several constraints as well as several opportunities to change the front-end package management workflow.<p>I wanted users to be able to add packages to their existing html markup, however strangely they might have designed it. I also wanted the markup to look &#x27;ok&#x27; after these new packages are inserted. This was quite a challenge. I also didn&#x27;t want to include all of the packages&#x27; code in each Plunk as that would really slow down the service and increase storage costs.<p>As a result, a trade-off (and possibly benefit) I&#x27;ve achieved in this system is that all package ressources must be accessible online (ideally via CDN).<p>The result is a system whereby the markup declares package dependencies and can be introspected and updated to newer package versions and&#x2F;or to identify existing packages.
评论 #7363065 未加载