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

[Bug]: Onesignal global type breaks other global types #42

Open
andersmar opened this issue Aug 15, 2024 · 3 comments
Open

[Bug]: Onesignal global type breaks other global types #42

andersmar opened this issue Aug 15, 2024 · 3 comments
Assignees

Comments

@andersmar
Copy link

andersmar commented Aug 15, 2024

What happened?

Our own global types stopped working after installing the onesignal-vue3 package.

This is because it still uses the @vue/runtime-core in module declaration, whereas 'vue' should be used instead (vue docs).

index.d.ts

declare module '@vue/runtime-core' {
    interface ComponentCustomProperties {
        $OneSignal: IOneSignalOneSignal;
    }
}

index.ts

declare module '@vue/runtime-core' {
  export interface ComponentCustomProperties {
    $OneSignal: IOneSignalOneSignal;
  }
}

What browsers are you seeing the problem on?

Other

What operating system are you running?

w11 pro 22H2

Steps to reproduce?

1. install package
2. define custom global type elsewhere
3. write the custom properties in a vue template

What did you expect to happen?

I expected both types to work.

The change described fixes the problem.

Relevant log output

No response

@cepicdalim
Copy link

Facing with same issue and the proposal for fixing issue is legit.

"This is because it still uses the @vue/runtime-core in module declaration, whereas 'vue' should be used instead (vue docs)."

@rgomezp
Copy link
Contributor

rgomezp commented Jan 10, 2025

@cepicdalim @andersmar thanks for calling attention to this issue.

The change needs to be made here -- though this needs to be tested to ensure it's not a breaking change.

PRs here won't be merged since this package is code-generated. It actually needs to be fixed upstream, however. I want to make sure we understand all the implications of the change.

Considerations:

  • module reference shift (will TypeScript setups or imports no longer recognize the $OneSignal property, causing type errors?)
  • do downstream projects need to update their code?
  • do we need to document this change?
  • should we deprecate the old declaration before removing it?
  • does vue2 face a similar issue?

cc @sherwinski

@kyng-cytro
Copy link

Currently working around this with bun patch

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

5 participants