Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a package manager for web (based on unpkg) #221

Open
osdevisnot opened this issue Oct 2, 2019 · 1 comment
Open

a package manager for web (based on unpkg) #221

osdevisnot opened this issue Oct 2, 2019 · 1 comment

Comments

@osdevisnot
Copy link

So after looking into #93, #57 and #152, it seems like we are moving towards a target where unpkg will be able to serve one file (bundled via rollup most likely) for a given dependency. This is awesome for serving files to the browser, but can also be used for more traditional package management needs.

Roughly, this can translate to one firing a upm install command, which will read dependencies and their versions from package.json or some other manifest and download ONLY the needed file (bundled) for those packages from unpkg.com (as opposed to full tar).

In a way this is similar to pika install, but unpkg adds tremendous speed improvements (specially with warm cache), since the bundling task is performed on server.

That said, I am filing this issue to validate the idea and to gather feedback/interest on having such tool available. I did put together a "concept on paper" implementation here if we want to perceive this idea.

Thoughts/Opinions?

@osdevisnot
Copy link
Author

So far this works well for packages that are bundled for ESM (i.e packages which serve only one file as dependency). Feel free to try using something like:

Install upm package manager using:

npm install -g unpkg-package-manager

then run init command in an existing project (which has dependencies)

upm init

finally, run install command to download the packages

upm install

Obvious issue exists with packages which has multiple files as the dep in module entry point.

Possible solutions to solve this:

  • unpkg rewrites the imports/requires to include full unpkg url
  • unpkg provides the `?bundle' flag to download rollupified bundle for the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant