Component URLs

A component URL is a URL that locates a component, including its declaration, program, and assets. In Components v2, component URLs are resolved to component declarations by a resolver.

Usage

The primary use of component URLs is to identify a component in the definition of a component instance, as part of a child declaration.

You should not use component URLs to identify component instances, as multiple component instances can share the same URL. For that purpose, instead use monikers.

Format

A component URL can, in principle, have any scheme. Some common schemes you may encounter are:

fuchsia-pkg

A fuchsia-pkg component URL is a package URL that locates a component distributed in a Fuchsia package.

It has the same format as package URL, with a resource path relative to the package root that locates a component manifest. This path is usually of the form meta/<manifest_name>.cm.

fuchsia-pkg://<repo-hostname>[/<pkg-name>[/<pkg-variant>][?hash=<pkg-hash>][#<path-to-manifest>]]

Example:

fuchsia-pkg://fuchsia.com/stash#meta/stash_secure.cm

fuchsia-boot

A fuchsia-boot component URL locates a component in the system boot image. This scheme is used to identify components that must be resolved during early boot before a fuchsia-pkg resolver is available. It has the following format:

fuchsia-boot:///<path-to-manifest-in-bootfs>

Example:

fuchsia-boot:///#meta/driver_manager.cm

http(s)

An http(s) component URL identifies a web page as a component. Such a component could be executed as a web page in a web runner, for example.

Example:

https://en.wikipedia.org/wiki/Hippos