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

chore: improve imports and repeat directives types #6981

Merged
merged 4 commits into from
May 4, 2023
Merged

Conversation

pskelin
Copy link
Contributor

@pskelin pskelin commented May 4, 2023

  • add .js imports in generated templates
  • improve repeat directive parameter types
  • update to "moduleResolution": "node16",

@pskelin pskelin requested a review from ilhan007 May 4, 2023 11:06
@pskelin pskelin requested a review from MarcusNotheis May 4, 2023 11:10
@pskelin pskelin merged commit cb061e0 into main May 4, 2023
@ilhan007 ilhan007 deleted the hbs2ts-repeat branch May 4, 2023 13:04
@ilhan007 ilhan007 requested a review from nnaydenow May 4, 2023 13:22
ilhan007 added a commit that referenced this pull request May 15, 2023
Recently we [changed](#6981) our tsconfig to use Module Resolution ["node 16",](https://www.typescriptlang.org/tsconfig#moduleResolution) instead of "node" to get better ECMAScript Module Support:
- 'node' for Node.js’ CommonJS implementation
- 'node16' or 'nodenext' for Node.js’ ECMAScript Module Support [from TypeScript 4.7](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs)

However, we faced issues on the application side. The TS compiler throws errors in Typescript applications that uses UI5 Web Components for files in applications' node_modules. More specifically, the problem was caused by new attribute  "'resolution-mode'" added to the auto-generated .d.ts files that requires also tsconfig change by the project installed our code.

```sh
Error: node_modules/@ui5/webcomponents/dist/DateComponentBase.d.ts:1:23 - error TS1452: 
'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`.
/// <reference types="openui5" resolution-mode="require"/>
```
Although these errors can be handled with `skipLibCheck` flag set to "true", it's a bad experience to require a particular flag to just make an app working and we decided to revert this as it's seems the setting is not stable enough and can cause unexpected problems for consumers.

Related to: #7020 (comment)
Reverts: #6981
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

Successfully merging this pull request may close these issues.

3 participants