Skip to content
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

Replace __VERSION__ with actual version number #8498

Closed
PuruVJ opened this issue Apr 14, 2023 · 3 comments · Fixed by #8502
Closed

Replace __VERSION__ with actual version number #8498

PuruVJ opened this issue Apr 14, 2023 · 3 comments · Fixed by #8502

Comments

@PuruVJ
Copy link
Collaborator

PuruVJ commented Apr 14, 2023

Describe the problem

Currently, svelte/compiler exports VERSION with type __VERSION__. It causes mismatch like these in upcoming svelte.dev

CleanShot 2023-04-15 at 02 09 01@2x

Describe the proposed solution

It'd be great to export it with the current svelte version number. Maybe something in the rollup config? rollup-plugin-replace

Alternatives considered

Let it be? 🤷

Importance

nice to have

@gtm-nayan
Copy link
Contributor

gtm-nayan commented Apr 15, 2023

It probably should be exported with just the type string, the primary use for the version field IMO would be using it for feature detection, and if it's the literal version string, typescript will complain along the lines of

This comparison appears to be unintentional because the types '"3.58.0"' and '...' have no overlap.

if you try to compare the version string with something.

@PuruVJ
Copy link
Collaborator Author

PuruVJ commented Apr 15, 2023

Aha! Makes sense. Yeah I think string would be a better type in that case

@Conduitry
Copy link
Member

Types fixed in 3.59.0.

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 a pull request may close this issue.

3 participants