Class EmbeddedSass.OutboundMessage.CanonicalizeRequest

  • All Implemented Interfaces:
    Message, MessageLite, MessageLiteOrBuilder, MessageOrBuilder, Serializable, EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
    Enclosing class:
    EmbeddedSass.OutboundMessage

    public static final class EmbeddedSass.OutboundMessage.CanonicalizeRequest
    extends GeneratedMessageV3
    implements EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
     A request for a custom importer to convert an imported URL to its canonical
     format.
     If the URL is not recognized by this importer, or if no stylesheet is found
     at that URL, `CanonicalizeResponse.result` must be `null`.
     Canonical URLs must be absolute, including a scheme. If the import is
     referring to a Sass file on disk, the importer is encouraged to respond
     with a `CanonicalizeResponse.result.file`, in which case the host will
     handle the logic of resolving partials, file extensions, and index files.
     If Sass has already loaded a stylesheet with the returned canonical URL, it
     re-uses the existing parse tree. This means that importers must ensure that
     the same canonical URL always refers to the same stylesheet, *even across
     different importers*. Importers must also ensure that any canonicalized
     URLs they return can be passed back to `CanonicalizeRequest` and will be
     returned unchanged.
     If this importer's URL format supports file extensions, it should
     canonicalize them the same way as the default filesystem importer:
     * The importer should look for stylesheets by adding the prefix `_` to the
       URL's basename, and by adding the extensions `.sass` and `.scss` if the
       URL doesn't already have one of those extensions. For example, if the URL
       was `foo/bar/baz`, the importer would look for:
       * `foo/bar/baz.sass`
       * `foo/bar/baz.scss`
       * `foo/bar/_baz.sass`
       * `foo/bar/_baz.scss`
       If the URL was foo/bar/baz.scss, the importer would just look for:
       * `foo/bar/baz.scss`
       * `foo/bar/_baz.scss`
       If the importer finds a stylesheet at more than one of these URLs, it
       should respond with a `CanonicalizeResponse.result.error` indicating that
       the import is ambiguous. Note that if the extension is explicitly
       specified, a stylesheet with another extension may exist without error.
     * If none of the possible paths is valid, the importer should perform the
       same resolution on the URL followed by `/index`. In the example above, it
       would look for:
       * `foo/bar/baz/_index.sass`
       * `foo/bar/baz/index.sass`
       * `foo/bar/baz/_index.scss`
       * `foo/bar/baz/index.scss`
       As above, if the importer finds a stylesheet at more than one of these
       URLs, it should respond with a `CanonicalizeResponse.result.error`
       indicating that the import is ambiguous.
     
    Protobuf type sass.embedded_protocol.OutboundMessage.CanonicalizeRequest
    See Also:
    Serialized Form