Skip to content
This repository was archived by the owner on Mar 25, 2018. It is now read-only.
This repository was archived by the owner on Mar 25, 2018. It is now read-only.

Decentralized Module Resolving w/ proof of concept #29

@formula1

Description

@formula1

Last conversation here - #26
I believe I was part of the problem and I'd like to get the thread started on the right foot again.

I'm basing most of this off the TC39 process which has been an effective means of getting features included into the w3c standards. Link here -https://tc39.github.io/process-document/

Purpose

  • Problem - modules are currently centralized to one location. With this has brought up problems such as
    • Naming taken by deprecated, abandoned, un-tested or purposefully empty repositories
    • Attempting to duplicate or reserve the data is an extreme task making the one server extremely important developing. I believe it was this year that one of the servers at npm went down causing fires and panic. I cried
  • Potential challengers
    • Mutability and Source of Truth - If the repo changes but the code doesn't this should be reflected. If there is a mutability issue, it can be resolved.
    • Maintaing Existing APIs - cli commands and possibly ability to require it as a module
    • Enabling servers to get started quickly - Ensuring someone that wants to be involved can get into it quickly
    • Standardization and Adapting - Ensuring changes in the software ecosystem can also be reflected here while maintaining backwards compatability and solid standards for internal use (Semver, package.json, etc)
    • Trust - Authentication, signing of packages, handing rougue machines. Something that likely others can speak more about.
  • Opportunities
    • Even a newbie can help node - Peer to Peer distribution allows for a newbie to give back to the community even if they aren't perfect coders (which few of us are)
    • People can see first hand of what node and the node community is capable of - Its one thing to 'hear' about all the awesome projects on hacker news but to see and be apart of one is a step further.
    • Individuals can create their own registries - Whether adding statistics, having a rigid universal testing suite or other, they don't have to depend on npm accepting their pull request. They can build their own.

Current Proposed Solution

This is a culmination of efforts from @joepie91 @ChALkeR @mbostock @scriptjs @formula1

For More Detailed Explaination

Overview
  • Enabling a Client to have Multiple Registries
    • Registries can advertise Responsibility, Statistics or etc - May choose to host a package or not by their own standards, May choose to offer developers statistics about downloads and queries. Ideas can come into fruition and possibly getting clients excited about developing for it.
    • Easy(ier?) Duplication gives backups to a client - By ensuring the delivery mechanism is not the package resolving mechanism, disk space will not be a heavy requirement. This allows for backups to be readilly available.
    • Rogue Registries can be removed - Likelyhood is minimal that npm would do anything absurd but there is a cost to trust. But allowing it to be removed easily, there is no issue.
  • Enabling a Client to have Multiple Distribution Mechanisms
    • Circumvents the need to upload to two locations - Client can receive direct from their wherever the author is writing to
    • Distributed amoungst Peers - Tends to be faster and also allows for individuals to give back to the community if they choose
    • Allow trusted download - They may choose to only download from one place they trust. This may be a mirror of another location
  • Enabling any Client to get even deeper into node
    • Peer to Peer -Clients can contribute to the peer to peer network giving back to the community even.
    • Inspiritaional - By seeing this sort of mechinism, it may inspire individuals to look and think differently about node and javascript.
    • Operating their own registry - Client seeing how simple a registry can be, may choose to start their own at minimal cost.
Psuedo Code

Installation

  • Client gives Semver to Registry and gets a Distribution Handle
  • Client figures out how to use the Distribution handle then uses it to download the package
  • Client Unpacks the download and moves it to the appropriate location

Publishing

  • Client gives handle or a tar to Registry
  • Registry figures out what it needs to do with the handle and Downloads it
  • Registry Unpacks it, Validates it, Indexes it then Allows their distribution method(s) to handle it
    • This may involve notifying distributors, which may or may not choose to mirror

Enabling a Client to Have Multiple Registries

  • Registries can advertise Responsibility, Statistics or etc - May choose to host a package or not by their own standards, May choose to offer developers statistics about downloads and queries. Ideas can come into fruition and possibly getting clients excited about developing for it.
  • Easy(ier?) Duplication gives backups to a client - By ensuring the delivery mechanism is not the package resolving mechanism, disk space will not be a heavy requirement. This allows for backups to be readilly available.
  • Rogue Registries can be added and removed - Likelyhood is minimal that npm would do anything absurd but there is a cost to trust.
Technologies To take inspiration from

Demo

https://github.com/formula1/decentralized-package-resolving-example

git clone https://github.com/formula1/decentralized-package-resolving-example
npm install
npm test

Its unoptimized, much of it is synchronous. But hey, I'd like to believe I'm paying my time and effort forward so that if this thing gets through I will feel like I was part of the solution. Every journey begins with a step I suppose.

PInging those who seemed interested: @scriptjs, @mikeal, @Martii, @ChALkeR, @joshmanders, @jasnell, @ashleygwilliams, @Qard, @bnoordhuis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions