Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[WIP] #49

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

[WIP] #49

wants to merge 4 commits into from

Conversation

graphemecluster
Copy link
Member

@graphemecluster graphemecluster commented Oct 7, 2024

Bundle type declaration to avoid exposing internal types and enforce encapsulation

TODOs

  • Convert Unicode escapes in outputted index.d.ts into actual code points
    Alternatively, use rollup-plugin-dts

@syimyuzya
Copy link
Member

syimyuzya commented Feb 4, 2025

  • Alternatively, use rollup-plugin-dts

We've used rollup-plugin-dts before, but it didn't build the correct module structure (edit: I've tried again. It does now, but it doesn't preserve the docs for any exported name, only showing wierd aliases), and it's not in active development for some time.

@syimyuzya
Copy link
Member

Nonetheless, I like the idea that we build multiple target formats. (btw do we really need the CJS target? I understand that the UMD one is for single-file distribution, and the ESM one for pakage managers. CJS just seems redundant 🤔

@graphemecluster
Copy link
Member Author

CJS just seems redundant 🤔

Actually I once thought so too (but nevertheless merged that PR. I forgot the reason why). Let’s remove it

@graphemecluster
Copy link
Member Author

I would like to try @microsoft/api-extractor, but I don’t think I’ll have the time to dig into it anytime soon. Help me take a look into it if you’ve got the time (unless you don’t think doubling the file size (before gzip) is a problem) 😄

@graphemecluster
Copy link
Member Author

@syimyuzya I don’t think the entire type definition is currently in a usable state:
https://arethetypeswrong.github.io/?p=tshet-uinh%400.15.1
So it seems crucial to give it a fix soon.

P.S. Be careful not to make the same mistake I made with the library mentioned above, which is a problem Masquerading as ESM/CJS:
https://arethetypeswrong.github.io/?p=to-jyutping%403.1.1

@syimyuzya
Copy link
Member

syimyuzya commented Mar 15, 2025

I just found that the ESM build in this configuration is also bundled into a single file 🤔

Is this really desired, as the UMD build already serves this purpose? edit: I got it. That's also for browser usage but with ESM.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants