Skip to content

Plugin option types out of date #150

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

Closed
chrstntdd opened this issue Oct 28, 2020 · 1 comment
Closed

Plugin option types out of date #150

chrstntdd opened this issue Oct 28, 2020 · 1 comment

Comments

@chrstntdd
Copy link

Hey folks, I'm noticing that the published type declarations seem to be out of date with the plugin options that are documented in the README.md.

Specifically, I'm noticing the mismatch with the hydratable option. It is not present on the Options interface, but it is kinda referenced within Options["compilerOptions"]. Additionally, generate is also missing, but declared within compilerOptions in the same way, yet the types line up when I'm using it.

image

I'm not sure of the right approach to this, but I would be willing to make this change and have the types match up with the public API.

My first thought was to sort of spread out the compilerOptions up one level, but that also looks like it would conflict with what the plugin is doing under the hood

// index.d.ts

interface Options {
  // ...
  hydratable:  CompileOptions['hydratable']
  generate:  CompileOptions['generate']
  // ...
}

Any thoughts?

Versions:

"svelte": "^3.29.4"
"rollup": "^2.32.1",
"rollup-plugin-svelte": "^6.1.0"
@lukeed
Copy link
Member

lukeed commented Oct 28, 2020

Hey,

Same-ish answer as sveltejs/template#180 (comment)

Currently master is unreleased, so any use of compilerOptions is not supported until 7.0 comes out.
Before than, any 6.x branch had an incomplete set of type definitions to begin with. This PR (#126) was meant to fix that, but in order for it to work consistently, it had to ensure a minimum requirement for svelte/compiler, which was a breaking change & kickstarted the 7.0 rc

You can send in PR on the 6.x branch to manually type the old options. Or you can just throw a @ts-ignore above the unknown options 😆

Hope that helps~!

@lukeed lukeed closed this as completed Oct 28, 2020
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

No branches or pull requests

2 participants