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

Expose svelte version in dev mode #4047

Closed
RedHatter opened this issue Dec 3, 2019 · 4 comments · Fixed by #4154
Closed

Expose svelte version in dev mode #4047

RedHatter opened this issue Dec 3, 2019 · 4 comments · Fixed by #4154
Labels
awaiting submitter needs a reproduction, or clarification

Comments

@RedHatter
Copy link
Contributor

It would be helpful to be able to determine what version of svelte a given bundle was build with. This would simplify attempting to support both old and new versions of svelte in svelte-devtools. This hasn't been an issue so far but I'm sure it eventually will as new version change the internals more.

I'm not quite sure where this would be exposed though.

@Conduitry Conduitry added awaiting submitter needs a reproduction, or clarification proposal labels Dec 3, 2019
@antony
Copy link
Member

antony commented Dec 22, 2019

I notice that the compiled output has /* App.svelte generated by Svelte v3.16.5 */ at the top of it.

Would it be possible to use this to determine version? Or would it be better to have a concrete version attribute exposed in the dev source?

@RedHatter
Copy link
Contributor Author

RedHatter commented Dec 22, 2019

@antony There's no easy/reliable way to access the raw source of the bundle.

One way to expose this would be in the dev event details. For example.

	dispatch_dev("SvelteRegisterBlock", {
		block,
		id: create_each_block.name,
		type: "each",
		source: "(4:0) {#each things as thing, index}",
		ctx,
                version: "3.16.5"
	});

@antony
Copy link
Member

antony commented Dec 22, 2019

@RedHatter gotcha. I've been looking at doing something similar this morning.

@Conduitry
Copy link
Member

This is now exposed in 3.17.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants