-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix enums for consumers using isolated modules. #5
Conversation
I definitely want to support isolated modules mode, which is why I have While I'd like to understand why the TS compiler isn't working as expected that can often be a foolish quest. I'm OK with this simple change as long as it doesn't affect performance -- did you try |
This TS issue looks potentially relevant, but it's not (yet) resolved. |
Sure thing, details below. If I interpret this correctly my machine is ~20% slower at executing JavaScript than what you used to create the baseline. 😉 Can't see a regression going from `3df15d4` → `364fb1` benchmarksBefore
After
This is the best explanation of the issue https://ncjamieson.com/dont-export-const-enums/#isolated-modules I've read to date. I suspect we end up implicitly exporting |
Thanks! I agree that performance seems to hold up, though it looks like my efforts to adjust benchmark results according to a dynamic empty loop baseline are completely ineffective. I'll merge and rerun the benchmarks on my machine to double check. And yeah, I found that blog post too, but I still can't make sense of what we're seeing. I do have |
Released in 0.8.3 -- thanks again! |
When importing
@lastolivegames/becsy
in a composite project or a project using theisolatedModules
flag, the following error is encountered:This PR moves all
const enum
toenum
to avoid the above interoperability issue.Let me know what you think!