Closed wesleybl closed 1 week ago
Name | Link |
---|---|
Latest commit | b160574f5ebf0cb927d10610cd5c2ed6e2e64b6c |
Latest deploy log | https://app.netlify.com/sites/volto/deploys/662f96b05d0b36000895b104 |
Name | Link |
---|---|
Latest commit | b160574f5ebf0cb927d10610cd5c2ed6e2e64b6c |
Latest deploy log | https://app.netlify.com/sites/plone-components/deploys/662f96b0234ad100086cd2b9 |
@wesleybl unfortunately, we cannot do this :( The types in packages/volto/types
are autogenerated, given the information tsc
can infer from the code and JSDoc annotations in the .js
code. See https://github.com/plone/volto/blob/e7d6f1c0be483c6560a552bae615b3f80ec21c1e/packages/volto/package.json#L42
This was done for convenience, because the prior situation was far worse, when coming to TS support and VSCode autocompletion and "go to reference" matters. Problem is that any change will be overwritten afterwards.
What we can do is to improve the JSDocs and hints in the code itself, so the generated types are improved. @wesleybl could you try this approach instead, then run the build:types
command and see if that improves?
Unfortunately, we will have to bear with this kind of things until the vast majority of our code base is not TS-based. :(
@wesleybl ok, now I read more carefuly, so your addon tests are failing because of this.
@wesleybl could you please share the test that cause the failure? Maybe we can add them to the test batteries in CI.
@tiberiuichim could you please check the typings? I want to make sure that we are not messing this up.
@wesleybl could you please share the test that cause the failure? Maybe we can add them to the test batteries in CI.
@sneridagh It is not a specific test. I think any test that import:
will give the error. I commented on the test that failed and another test started to fail.
The types in packages/volto/types are autogenerated, given the information tsc can infer from the code and JSDoc annotations in the .js code
After your commit, the parameters became optional, even after running build:types
. So I think it's ok now. Thanks!
The function works without these parameters. Avoid error:
fixes: #5985