Search Unity

What is a Scoped Package Registry?

Discussion in 'Package Manager' started by MoistDumpling14, Jun 3, 2019.

  1. MoistDumpling14

    MoistDumpling14

    Joined:
    Sep 8, 2018
    Posts:
    139
    Hey, I am reading the manual and was confused as to what a scoped package registry was exactly. Specifically, I am trying to understand this sentence from the manual:

    "A scoped registry allows you to use a registry in addition to the Unity default registry where you can host your own packages. Using scoped registries ensures that the Package Manager always maps a package to one and only one registry, guaranteeing a consistent result regardless of network conditions.

    For example, if you set up your own server where you are hosting some of the Unity packages, you could end up getting the package from the wrong registry if one registry is temporarily unavailable, even if the Package Manager always searches the registries in the same order. However, if you set up a scoped registry for your own server, the package always maps to one and only one registry, guaranteeing a consistent result regardless of network conditions."
     
  2. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
  3. MoistDumpling14

    MoistDumpling14

    Joined:
    Sep 8, 2018
    Posts:
    139
    So just to clarify, a scoped package is just another registry in addition to the default unity registry. The reason you would use a scoped registry is so you can host your own packages. My question is what does it mean to "host" your own packages.
     
  4. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
  5. MoistDumpling14

    MoistDumpling14

    Joined:
    Sep 8, 2018
    Posts:
    139
    Could you explain the example above that I posted at the beginning I'm still having a hard time understanding it.

    For example, if you set up your own server where you are hosting some of the Unity packages, you could end up getting the package from the wrong registry if one registry is temporarily unavailable, even if the Package Manager always searches the registries in the same order. However, if you set up a scoped registry for your own server, the package always maps to one and only one registry, guaranteeing a consistent result regardless of network conditions.

    I'm not exactly sure what it means to have a server hosting unity packages and how that's different than just having a scoped registry.
     
  6. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    I’ll reach out to our technical writer and share your difficulty to understand this part of the manual. I’ll suggest them to update the documentation to make it clearer.

    Thank you for your feedback. I’ll keep you posted when the documentation is updated.
     
    MoistDumpling14 likes this.
  7. use_unity

    use_unity

    Unity Technologies

    Joined:
    Dec 26, 2017
    Posts:
    2
    Hi, I’m sorry you are finding the scoped registry documentation difficult to understand.

    In answer to your question, most people or organizations would not host their own version of a Unity package. However, there are rare cases where an organization might need to create a local registry inside a closed network and host their packages from there but still retain the Unity package server as the main registry.

    Does that help?
     
    MoistDumpling14 likes this.
  8. MoistDumpling14

    MoistDumpling14

    Joined:
    Sep 8, 2018
    Posts:
    139
    So basically a scoped registry is a registry in addition to the default unity registry where you can host your own packages. However not a lot of people would really need to use a scoped registry except organizations that may want to host their own version of a package, without getting it mixed up with the original one from the original registry. Is that correct or no?

    I'm not exactly sure what it means to have a server hosting unity packages and how that's different than just having a scoped registry. Like... what is a server?
     
  9. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    In the case of scoped registries, companies/individuals would need to have somewhere to put their custom Unity packages - this is the 'server'. A package server is basically an application that keeps track of packages and is also where packages are stored - i.e. the destination of the scoped package repository URL.

    An example of a 'package server' that Unity has mentioned in some of their documentation is Verdaccio - see their 'What is Verdaccio' page.
     
  10. MoistDumpling14

    MoistDumpling14

    Joined:
    Sep 8, 2018
    Posts:
    139
    How could you set up your own server and host unity packages on it and what could an example of that be? Does each registry get it's own server?