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

fix: vue-i18n type definition for vue package #1919

Merged
merged 2 commits into from
Aug 16, 2024
Merged

Conversation

BobbieGoede
Copy link
Member

As discussed in #1888 we will need this to prevent breaking types!

@kazupon kazupon added the Type: Improvement Includes backwards-compatible fixes label Aug 16, 2024
@kazupon kazupon merged commit b07a9a4 into intlify:v9 Aug 16, 2024
@zyro23
Copy link

zyro23 commented Aug 17, 2024

after updating from 9.13.1 to 9.14.0, vue-tsc fails with errors like:

src/views/MyView.vue:69:14 - error TS2339: Property '$t' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { ... 17 more ..., {}>'.

69           {{ $t('foo') }}
                ~~

src/views/MyView.vue:99:20 - error TS2339: Property '$d' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { ... 17 more ..., {}>'.

99                 {{ $d(myDate, 'dateTime') }}
                      ~~

using composition api with vue-3.4.38, typescript-5.5.4, vue-tsc-2.0.29.
as far as ide's are concerned, vs code as well as intellij idea show the same errors.
anything i am missing? thanks!

@BobbieGoede
Copy link
Member Author

after updating from 9.13.1 to 9.14.0, vue-tsc fails with errors like:

src/views/MyView.vue:69:14 - error TS2339: Property '$t' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { ... 17 more ..., {}>'.

69           {{ $t('foo') }}
                ~~

src/views/MyView.vue:99:20 - error TS2339: Property '$d' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { ... 17 more ..., {}>'.

99                 {{ $d(myDate, 'dateTime') }}
                      ~~

using composition api with vue-3.4.38, typescript-5.5.4, vue-tsc-2.0.29. as far as ide's are concerned, vs code as well as intellij idea show the same errors. anything i am missing? thanks!

This happens when there is a (sub)dependency that is augmenting @vue/runtime-core instead of vue installed in your project, can you check if this is the case?

@zyro23
Copy link

zyro23 commented Aug 17, 2024

i hope i understood your question correctly - looks like at least these two dependencies are declaring/augmenting @vue/runtime-core:

update: i think both are being worked on:

for the time being, i am fine with staying on vue-i18n-9.13.1 and will wait for the dependencies to align.

thanks again.

@BobbieGoede
Copy link
Member Author

@zyro23
That's correct, sorry for the inconvenience! Let's hope the other dependencies update their types soon 🙏

@florianMo
Copy link

florianMo commented Aug 29, 2024

Blankll added a commit to geek-fun/dockit that referenced this pull request Sep 7, 2024
![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)


<h3>Snyk has created this PR to upgrade vue-i18n from 9.13.1 to
9.14.0.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.

<hr/>


- The recommended version is **1 version** ahead of your current
version.

- The recommended version was released on **22 days ago**.



<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>vue-i18n</b></summary>
    <ul>
      <li>
<b>9.14.0</b> - <a
href="https://github.com/intlify/vue-i18n/releases/tag/v9.14.0">2024-08-16</a></br>
<h2>What's Changed</h2>
<h3>⚡ Improvement Features</h3>
<ul>
<li>fix: vue-i18n type definition for vue package by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/BobbieGoede/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/BobbieGoede">@ BobbieGoede</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="2470535823" data-permission-text="Title is private"
data-url="intlify/vue-i18n#1919"
data-hovercard-type="pull_request"
data-hovercard-url="/intlify/vue-i18n/pull/1919/hovercard"
href="https://github.com/intlify/vue-i18n/pull/1919">#1919</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link"
href="https://github.com/intlify/vue-i18n/compare/v9.13.1...v9.14.0"><tt>v9.13.1...v9.14.0</tt></a></p>
      </li>
      <li>
        <b>9.13.1</b> - 2024-04-20
      </li>
    </ul>
from <a
href="https://github.com/intlify/vue-i18n-next/releases">vue-i18n GitHub
release notes</a>
  </details>
</details>

---

> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.

---

**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._

**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI3YzAzMDc1Ni02YjQ4LTQyYWItOGM4Ni01YmNjMmQ3NTgwZWYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjdjMDMwNzU2LTZiNDgtNDJhYi04Yzg2LTViY2MyZDc1ODBlZiJ9fQ=="
width="0" height="0"/>

> - 🧐 [View latest project
report](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24/settings/integration?pkg&#x3D;vue-i18n&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"vue-i18n","from":"9.13.1","to":"9.14.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"7c030756-6b48-42ab-8c86-5bcc2d7580ef","prPublicId":"7c030756-6b48-42ab-8c86-5bcc2d7580ef","packageManager":"npm","priorityScoreList":[],"projectPublicId":"d19c39b4-9b25-4232-b09a-2d71e94c8a24","projectUrl":"https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2024-08-16T17:05:44.725Z"},"vulns":[]}'

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
@ReindDooyeweerd
Copy link

ReindDooyeweerd commented Sep 10, 2024

How to find out which modules exactly are using runtime-core?

Because i found out that vue-responsiveness was referencing to it with grep -r "declare module '@vue/runtime-core'" node_modules/ but even after fixing that package locally i keep running into Property '$t' does not exist on type 'CreateComponentPublicInstanceWithMixins<ToResolvedProps<{}, {}>, issues.

 grep -r "declare module '@vue/runtime-core'" node_modules/
node_modules//@vue/runtime-dom/dist/runtime-dom.d.ts:declare module '@vue/runtime-core' {
node_modules//@vue/runtime-core/dist/runtime-core.d.ts: * declare module '@vue/runtime-core' {
node_modules//@vue/runtime-core/dist/runtime-core.d.ts: * declare module '@vue/runtime-core' {
node_modules//@vue/runtime-core/dist/runtime-core.d.ts:declare module '@vue/runtime-core' {
grep -r "import '@vue/runtime-core'" node_modules/

Last one returns nothing

ReindDooyeweerd added a commit to ReindDooyeweerd/vue-responsiveness that referenced this pull request Sep 10, 2024
@hinogi
Copy link
Contributor

hinogi commented Oct 1, 2024

I have this problem in v10.0.0 and pug templates still

Blankll added a commit to geek-fun/dockit that referenced this pull request Oct 21, 2024
<h3>Snyk has created this PR to upgrade vue-i18n from 9.14.0 to
9.14.1.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>

- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **25 days ago**, on 2024-09-26.


<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>vue-i18n</b></summary>
    <ul>
      <li>
<b>9.14.1</b> - <a
href="https://snyk.io/redirect/github/intlify/vue-i18n/releases/tag/v9.14.1">2024-09-26</a></br>
<h2>What's Changed</h2>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>fix: messages <code>deepCopy</code> mutates <code>src</code>
arguments by <a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/BobbieGoede/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/BobbieGoede">@ BobbieGoede</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="2549815383" data-permission-text="Title is private"
data-url="intlify/vue-i18n#1975"
data-hovercard-type="pull_request"
data-hovercard-url="/intlify/vue-i18n/pull/1975/hovercard"
href="https://snyk.io/redirect/github/intlify/vue-i18n/pull/1975">#1975</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link"
href="https://snyk.io/redirect/github/intlify/vue-i18n/compare/v9.14.0...v9.14.1"><tt>v9.14.0...v9.14.1</tt></a></p>
      </li>
      <li>
<b>9.14.0</b> - <a
href="https://snyk.io/redirect/github/intlify/vue-i18n/releases/tag/v9.14.0">2024-08-16</a></br>
<h2>What's Changed</h2>
<h3>⚡ Improvement Features</h3>
<ul>
<li>fix: vue-i18n type definition for vue package by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/BobbieGoede/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/BobbieGoede">@ BobbieGoede</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="2470535823" data-permission-text="Title is private"
data-url="intlify/vue-i18n#1919"
data-hovercard-type="pull_request"
data-hovercard-url="/intlify/vue-i18n/pull/1919/hovercard"
href="https://snyk.io/redirect/github/intlify/vue-i18n/pull/1919">#1919</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link"
href="https://snyk.io/redirect/github/intlify/vue-i18n/compare/v9.13.1...v9.14.0"><tt>v9.13.1...v9.14.0</tt></a></p>
      </li>
    </ul>
from <a
href="https://snyk.io/redirect/github/intlify/vue-i18n/releases">vue-i18n
GitHub release notes</a>
  </details>
</details>
<hr/>

**Note:** *You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs.*

For more information: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI1YjVkZjViYS00OWIzLTRmNzQtOWFhMy03Nzc3ZWYyZTEwYzYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjViNWRmNWJhLTQ5YjMtNGY3NC05YWEzLTc3NzdlZjJlMTBjNiJ9fQ=="
width="0" height="0"/>

🧐 [View latest project
report](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24/settings/integration?pkg&#x3D;vue-i18n&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!---
(snyk:metadata:{"prId":"5b5df5ba-49b3-4f74-9aa3-7777ef2e10c6","prPublicId":"5b5df5ba-49b3-4f74-9aa3-7777ef2e10c6","dependencies":[{"name":"vue-i18n","from":"9.14.0","to":"9.14.1"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"d19c39b4-9b25-4232-b09a-2d71e94c8a24","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2024-09-26T09:05:56.169Z","isPrivateUpgrade":false},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]})
--->

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement Includes backwards-compatible fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants