Closed kamoshi closed 2 weeks ago
I am aware of the situation with wikidata-sdk
, though I did not realize users of citation-js
would get warnings too. wikidata-sdk
was a wrapper around wikibase-sdk
before v9.0.0 of the latter was released. Since wikibase-sdk v9.0.0 however, the module uses ESM-only instead of CommonJS which would force citation-js
(and its users) to switch to ESM-only too. So the deprecated wikidata-sdk
is still the latest available version. I will see if I can avoid the deprecation warning anyway.
It's more than a warning. I get an error and loss of function.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wikibase SDK Error Example</title>
</head>
<body>
<script type="module">
import { simplify } from 'https://cdn.jsdelivr.net/npm/wikibase-sdk@10.2.1/+esm';
import Cite from 'https://cdn.jsdelivr.net/npm/citation-js@0.5.0/+esm';
document.addEventListener('DOMContentLoaded', async function () {
try {
// Sample BibTeX string for demonstration
const bibText = `
@article{Loomes2017,
title={Loomes Title},
author={Loomes, Name},
journal={Journal of Examples},
year={2017}
}`;
const citationInstance = new Cite(bibText);
console.log(citationInstance);
// Example usage of simplify function from wikibase-sdk
const simplified = simplify.labels({
en: { value: 'example', language: 'en' }
});
console.log(simplified);
} catch (error) {
console.error("Error:", error);
}
});
</script>
</body>
</html>
Thank you for notifying me. I'm on holiday but I'll work on it when I can.
I get the following warning when updating this package:
This subdependency can be found here: https://github.com/citation-js/citation-js/blob/main/packages/plugin-wikidata/package.json
The package wikidata-sdk has been renamed to wikibase-sdk.