-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor with ES6 class syntax #373
Conversation
Yaaaay, alright, let’s get down to business! First of all, thank you so much for taking the time to bring improvements, I truly appreciate it. I think I would like if we could break down the 3 items into 3 separate PRs:
Do you think that‘s possible? This way we can merge them in isolation and the changelog is a little nicer. :) |
I can do that. I think items (2) and (3) could be in the same PR, because in my mind, adjusting the rollup config is a necessary response to migrating to class syntax. |
Makes sense. Although we could do drop the |
Sure! To confirm my understanding, the sequence of PRs is:
Is that right? For what it's worth, I think you could delay cutting a release until I complete the TypeScript migration because we aren't meaningfully changing the user-facing API, but of course I defer to you |
Yes, that sounds fair! I think we can bundle all this in v8 for safety. And the order sounds right. I’m also super happy to support any way I can. I don’t want to abuse your time. 😊 ✨ |
Don't worry about it! I can get started in the next few minutes. As to your question about whether folks would want to copy the compiled code: Maybe the readme could link to some CDNs that host the code? I don't think there's a huge need for direct access to the compiled code these days, though? |
Yeah, you’re probably right. I guess we could link to Skypack: https://www.skypack.dev/view/a11y-dialog |
Summary
In addition to switching to class syntax, this PR:
.gitignore
, so only the source files are committed to version controlcreate
method, as the constructor serves the same purpose andcreate
is not advertised externallyIt's worth noting that, while switching to class syntax makes the ESM files slightly smaller, the transpilation of class syntax to ES5 makes the UMD output slightly bigger.
Size of UMD output after this migration: 1.5kb (
+1kb)-1kb)Size of ESM output after this migration: 1.2kb (