-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing support for dependency discovery in JSON-LD for schemas #1935
Comments
Update: Made a (quick) plugin for it: https://github.com/bre7/parcel-plugin-schemaorg Not sure if this will be considered as a core functionality. (thanks Jasper for the template 😉) |
Very cool. Would you like to make a PR to add that to core? I think it will be much easier to maintain there without depending on the internal implementation details of HTMLAsset in a plugin. |
Sure, but there's a critical issue that needs fixing first (and I'm not really sure how to do it): paths aren't allowed, only full URLs. How can Parcel deal with it ? I did think about a possible workaround:
Current:<script type="application/ld+json">
{
"image": "/images/header.a9i39we.jpeg",
"logo": "/images/logo.aa4d5d5.png"
}
</script> Expected<script type="application/ld+json">
{
"image": "https://parceljs.org/images/header.a9i39we.jpeg",
"logo": "https://parceljs.org/images/logo.aa4d5d5.png"
}
</script> |
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
The text was updated successfully, but these errors were encountered: