Skip to content

Missing support for dependency discovery in JSON-LD for schemas #1935

@bre7

Description

@bre7

https://github.com/parcel-bundler/parcel/blob/master/src/assets/HTMLAsset.js#L64 JSON is skipped. I know schema.org specs are quite extensive but there are a few basics: image / logo for assets.

🙋 feature request

Assets used in JSON-LD schemas aren't added to the dependency tree. And as a result are missing from builds.

🤔 Expected Behavior

A minimal subset of the attributes should be included in parcel, just like it was done with Open Graph, etc: #747

😯 Current Behavior

Nothing happens since application/ld+json scripts aren't recognized.

💁 Possible Solution

Parse JSON, fetch attributes that match a list (almost the same as #747) and finally add them as dependencies.

💻 Examples

<script type="application/ld+json">
{
  "@context": "http://www.schema.org",
  "@type": "xxx",
  "name": "Parcel Bundler",
  "url": "https://parcel.url/",
  "image": "./images/header.jpeg",
  "logo": "./images/logo.png"
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions