Closed darobin closed 9 years ago
If I'm reading this right, should be fine? http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld
No, that's unrelated. It offers a way of interpreting JSON-LD as JSON using a specific HTTP header.
What defines whether it is fine or not is largely whether it is expected to be served over the web with the correct media type, that sort of consideration.
just saw that +1 with me did not realize that brfs
was adding so much overhead
We've just gone from an overhead of 56.5K to one of 0.6K (unminified); I reckon that's a win :)
Note: I just thought that if we need this served over the Web with the right media type, we could add it to @scienceai/resource and force the correct type in code there.
Would it be a problem to rename
article.jsonld
toarticle.json
?The reason I ask is because if we used the latter,
index.js
could justrequire('./article.json')
and export the return value directly instead of needingfs
,path
, andJSON
. This doesn't seem like much, but in turn it requiresbrfs
and a bunch of other things. This leads the browserified version to be 65K — roughly ten times the size of its useful payload.Conversely, if the browserified version is not needed, we could drop it.