Skip to content

Conversation

@eatsjobs
Copy link
Contributor

@eatsjobs eatsjobs commented Jan 20, 2025

Typescript types generation fails with

esm/dom/utils.js:8:14 - error TS4118: The type of this node cannot be serialized because its property '__@nodeType@27111' cannot be serialized.

The jsdoc comment fix the issue
I also added two commands to check the types and the package.json exports.

Note: publint asserts that the types field in package.json must be the first one. this is why I moved it at the top of each exports section

@eatsjobs
Copy link
Contributor Author

@WebReflection Hey Andrea, you are probably busy in more interesting things but will you have time to review this?

@WebReflection
Copy link
Owner

I think this breaks non TS use cases, all CDNs that use exports fields to understand how to reach files and so on ? ... I don't use TS so when I see my packages don't have any .js in there anymore it's a no-go out of the box.

But yeah, I've been super busy ... also v5 is kinda coming out (hopefully soon) so I have little interest in fixing things too much in here because the new thing is fully typed (well, it's JSDoc TS but it works?) so ... let's find a good compromise:

  • I want this to work without issues on VSCode
  • I want this to work with CDNs that provide uhtml out of the box out of imports
  • I want .js files to be explicitly defined in the pcakge.json as resources to use when modules are imported

can we have all that?

@eatsjobs
Copy link
Contributor Author

I think this breaks non TS use cases, all CDNs that use exports fields to understand how to reach files and so on ? ... I don't use TS so when I see my packages don't have any .js in there anymore it's a no-go out of the box.

But yeah, I've been super busy ... also v5 is kinda coming out (hopefully soon) so I have little interest in fixing things too much in here because the new thing is fully typed (well, it's JSDoc TS but it works?) so ... let's find a good compromise:

  • I want this to work without issues on VSCode
  • I want this to work with CDNs that provide uhtml out of the box out of imports
  • I want .js files to be explicitly defined in the pcakge.json as resources to use when modules are imported

can we have all that?

Sorry just seeing the message. what do you mean that this breaks cdn use cases? 🤔 I mean how this breaks it. maybe I'm missing something

@eatsjobs
Copy link
Contributor Author

@WebReflection
Btw you already have this kind of import/types defined in the code for example here https://github.com/WebReflection/uhtml/blob/main/esm/dom/attribute.js#L19

And here are the result of the "check:types" task.

image

@WebReflection WebReflection merged commit 03106f6 into WebReflection:main Apr 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants