-
Notifications
You must be signed in to change notification settings - Fork 8
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
Replace deprectated importsNotUsedAsValues
option with verbatimModuleSyntax
#2512
Conversation
@mollykreis will you buddy this change? |
...r-workspace/nimble-angular/table-column/date-text/nimble-table-column-date-text.directive.ts
Outdated
Show resolved
Hide resolved
…rbatimModuleSyntax', too
…them for use by clients." This reverts commit bd45e54.
...r-workspace/nimble-angular/table-column/date-text/nimble-table-column-date-text.directive.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR is in draft and build is failing but I was reset. I'm assuming still in dev and I'm not reviewing yet but FYI in-case a review was expected.
importsNotUsedAsValues
option with verbatimModuleSyntax
in Angular projectsimportsNotUsedAsValues
option with verbatimModuleSyntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to wait for any of the other code owners to submit this.
There were three tab scrolling tests failing in Webkit, but I suspect they must be intermittent. I've restarted the build, and I'll disable those tests in a separate PR, assuming my change isn't somehow responsible. |
...kspace/nimble-angular/src/directives/list-option-group/nimble-list-option-group.directive.ts
Show resolved
Hide resolved
…b.com/ni/nimble into users/makinc/use-verbatimmodulesyntax
Pull Request
🤨 Rationale
The
importsNotUsedAsValues
TypeScript option is deprectated and will stop working in TypeScript 5.5. It is replaced byverbatimModuleSyntax
.My motivation for this change is that while updating Nimble to Angular 18, I found that
importsNotUsedAsValues
was forcing me to do a type-only import ofRouter
andActivatedRoute
inrouter_link.ts
. But doing so caused a different error forNimbleAnchorRouterLinkWithHrefDirective
:Both
Router
andActivatedRoute
are parameters to theRouterLink
constructor. The problem is that if we do a type-only import ofRouter
andActivatedRoute
, the compiler doesn't know that they are decorated to be injectable. UsingverbatimModuleSyntax
solves this by allowing us to import from the definition file rather than the type declaration file for those types, even though we're not directly using the definition.This PR changes the option for the Angular projects, as well as
nimble-components
,spright-components
, andstorybook
.👩💻 Implementation
Had to update all imports of type symbols to explicitly say
type
.🧪 Testing
Builds and existing tests pass.
✅ Checklist