HTML Depends on TypeScript
Latest versions.
For which package is this issue?
HTML
Describe the issue in a sentence or two.
The HTML package depends on TypeScript, despite only using as a Dev Dep
Issue Type (Can be multiple)
- [ ] Build - Can’t install or import the SDK
- [x] Performance - Performance issues
- [ ] Behaviour - Functions aren’t working as expected
- [ ] Documentation - Inconsistency between the docs and behaviour
- [ ] Incorrect Types
- [x] Other (Install)
Steps to reproduce
https://www.npmjs.com/package/@cloudinary/html?activeTab=dependencies
Error screenshots
n/a
Browsers (if issue relates to UI, else ignore)
n/a
Versions and Libraries (fill in the version numbers)
package SDK version Node - n/a (Deno) NPM - n/a (Deno)
Config Files (Please paste the following files if possible)
package.json (n/a)
deno.json (trimmed for brevity):
{
"nodeModulesDir": "auto",
"imports": {
"@biomejs/biome": "npm:@biomejs/biome@^1.9.4",
"@cloudinary/react": "https://esm.sh/@cloudinary/[email protected]?external=*",
"@cloudinary/url-gen": "npm:@cloudinary/url-gen@^1.21.0",
"@fresh/plugin-tailwind": "jsr:@fresh/plugin-tailwind@^0.0.1-alpha.7",
"@preact/signals": "npm:@preact/signals@^1.3.2",
"fresh": "jsr:@fresh/core@^2.0.0-alpha.29",
"preact": "npm:preact@^10.26.2",
"tailwindcss": "npm:tailwindcss@^3.4.17"
},
"scopes": {
"https://esm.sh/": {
"@cloudinary/hrml": "npm:@cloudinary/html@",
"@types/react": "npm:[email protected]/compat",
"client-only": "npm:[email protected]",
"react": "npm:[email protected]/compat",
"react/jsx-runtime": "npm:[email protected]/jsx-runtime",
"react-dom": "npm:[email protected]/compat",
"react-dom/test-utils": "npm:[email protected]/test-utils"
}
}
}
Repository
n/a
Also, isBrowser is based on window instead of document, which means it's incorrect while running on Deno (and other modern runtimes).
https://github.com/cloudinary/frontend-frameworks/blob/fbb7d159158090f639fea9eda981c962b9c985db/packages/html/src/utils/isBrowser.ts#L4-L6
And there's no exports field, so it can't get consumed as ESM and it doesn't use .mjs extension for ESM so it probably can't be imported even with an exports field.
I'd be happy to help clean it up in a month (project I'm using cloudinary for is very far behind).
Hi @lishaduck. Thanks for your comments. We will review this internally and get back to you.
It's been a month! Would y'all be open to a PR(s) to clean up the repo?
(Also, to double check, y'all don't have a CLA, do you?)
@lishaduck sorry for the delay, we have opened an internal ticket to work on this further, however there is no ETA currently but we will post again when we complete it.