Skip to content

Conversation

@iacore
Copy link
Contributor

@iacore iacore commented Apr 13, 2024

This works. Closes #111.

@iacore iacore marked this pull request as ready for review April 13, 2024 13:09
.replace(/^(\s+)replaceWith\(([^}]+?)\}/m, '$1/* c8 ignore start */\n$1replaceWith($2}\n$1/* c8 ignore stop */')
.replace(/^(\s+)(["'])use strict\2;/m, '$1$2use strict$2;\n\n$1const { constructor: DocumentFragment } = document.createDocumentFragment();')
.replace(/^[^(]+/, '')
.replace(/\n exports\.Hole = Hole;[\S\s]*return exports;/m, `
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what has this to do with this MR?

Copy link
Contributor Author

@iacore iacore Apr 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixes type hints of uhtml/init. Without this, const { html, render } = init(document) will not have types (or rather be any). See https://git.envs.net/iacore/data-soup/src/commit/fc8fbb1bb35d071caf01963e53716d95cc4ddf79/server.js#L19

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK ... then we need to do a bit more ... to start with, the exports object is not needed, we need to replace that too. I now need to maintain manually all exports in this file + it's not clear once we remove tsc what is typescript dependency doing in here at all ... this feels like a breaking change too ... thoughts?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this line feels particularly cumbersome render : keyed$1,

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm ... I think this is landing in here with better logic to let me publish more than just init.js there: #114

@WebReflection
Copy link
Owner

uhm ... I think this is landing in here with better logic to let me publish more than just init.js there: #114

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.

Type definitions are buggy

2 participants