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

Use web-types from symlinked projects #1

Closed
igisev opened this issue Jul 23, 2019 · 10 comments
Closed

Use web-types from symlinked projects #1

igisev opened this issue Jul 23, 2019 · 10 comments
Assignees
Labels
bug Something isn't working tracked in YouTrack

Comments

@igisev
Copy link

igisev commented Jul 23, 2019

WebStorm 2019.2 EAP

We try to connect web types to our project as a local file.

  1. Created two Vue projects
  2. In the first project, we created the types/web-types.json file, and in the package.json we added the line
    "web-types": "types/web-types.json",
  3. In the second project, we connected the first project via yarn link

This does not work.
In the second project there are no visible components from the first project.
What are we doing wrong?

File types/web-types.json:

{
  "framework": "vue",
  "name": "ui",
  "version": "0.0.1",
  "contributions": {
    "html": {
      "types-syntax": "typescript",
      "tags": [
        {
          "name": "MyBtn",
          "attributes": [
            {
              "name": "disabled",
              "type": "boolean"
            },
            {
              "name": "title",
              "type": "string"
            }
          ],
          "events": [
            {
              "name": "click"
            }
          ],
          "slots": []
        }
      ],
      "attributes": [
      ]
    }
  }
}
@piotrtomiak
Copy link
Collaborator

piotrtomiak commented Jul 23, 2019

@igisev It seems that the problem might be with yarn link. I will investigate how it works and let you know. It would be great if you can share both project's package.json files. Thanks for your interest in web-types!

@igisev
Copy link
Author

igisev commented Jul 23, 2019

It's my pleasure )
Both projects are created via @vue/cli.
The difference between the two package.json:

"dependencies": {
   "-test": "file:../-test",
   ...
}

I performed "Invalidate caches / Restart" and suddenly it all worked! O_o
The second project began to see <my-btn>.

The solution was in rebooting WebStorm =\
But this only gives rise to new questions.

In the first project in the types/web-types.json file, I changed MyBtn to NotMyBtn but the changes in the second draft did not apply.
This is very bad.

I believe that changes should be applied on the fly during development.
Do you agree with me? =)

@piotrtomiak
Copy link
Collaborator

piotrtomiak commented Jul 23, 2019

@igisev That's actually great! The changes should definitely be updated, but I haven't foreseen that someone will use web-types for his own code development! So the caches are adjusted for more static node_modules behaviour :) I'll definitely fix the issue. You can follow up the issue in WebStorm tracker https://youtrack.jetbrains.com/issue/WEB-40166 as well

@piotrtomiak piotrtomiak self-assigned this Jul 23, 2019
@piotrtomiak piotrtomiak added bug Something isn't working tracked in YouTrack labels Jul 23, 2019
@igisev
Copy link
Author

igisev commented Jul 23, 2019

Thanks so much for the quick response.
We are waiting for bugfix =)

@igisev igisev changed the title Use web-types Use web-types from symlinked projects Jul 23, 2019
@piotrtomiak
Copy link
Collaborator

@igisev the issue has been fixed. The fix will be available in the 2019.2.1 release and EAPs

@h311x
Copy link

h311x commented Nov 14, 2019

Hey there! Thanks for your work!

So for some reason I'm experiencing the same issue, even though I'm using WebStorm 2019.3 EAP Build #WS-193.5096.13.

I have basically the same setup. 2 project, one connected to another with yarn link.
I noticed that only when I do "File > Reload All From Disk" everything is getting reindexed and webstorm recognizes new types.

@gejgalis
Copy link

gejgalis commented Nov 14, 2019

I have the same issue using LernaJS which uses symlinks between multiple projects.
IntelliJ IDEA 2019.3 EAP (Ultimate Edition)
Build #IU-193.4932.9, built on October 30, 2019

@piotrtomiak
Copy link
Collaborator

@h311x @gejgalis unfortunately problems with stale symlinked folders are a known issue in IntelliJ platform - https://youtrack.jetbrains.com/issue/IDEA-65174 , https://youtrack.jetbrains.com/issue/WEB-25409 .

@h311x
Copy link

h311x commented Nov 15, 2019

@piotrtomiak these issues, it seems, have been created a really long time ago... One of them is even ten years ago

Are they going to be solved any time soon? Or is there any info about it?

@piotrtomiak
Copy link
Collaborator

@h311x I honestly don't know. The issue has been recognized as a very important now and it seems that it may be resolved in the next release cycle (2020.x). Please vote it and maybe put some comments. It may build up pressure on the core team to fix this. I am sorry for the inconvenience! If possible I'll try to get involved into fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked in YouTrack
Projects
None yet
Development

No branches or pull requests

4 participants