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(NA): upgrade typescript into v5.1.6 #186437

Merged
merged 68 commits into from
Jul 29, 2024
Merged

Conversation

mistic
Copy link
Member

@mistic mistic commented Jun 19, 2024

This PR bumps the Typescript version used on Kibana into v5.1.6. The full set of changes can be found here and here.

In order to make assumptions over the codebase and all the type of errors I choose to mark the failures with @ts-expect-error and let each team decide how to handle it.

There is a list below with the files (and teams those belong to) where the annotations were added. If each team could provide help of fixing the ones under their domain it would be fantastic. It can be done in this PR or in subsequent ones.

Here it goes the list for follow up:

@elastic/kibana-core

@elastic/kibana-data-discovery

@elastic/obs-knowledge-team

@elastic/kibana-esql

@elastic/kibana-management

@elastic/kibana-security

@elastic/appex-sharedux

@elastic/kibana-visualizations

@elastic/kibana-presentation

@elastic/response-ops

@elastic/ml-ui

@elastic/search-kibana

@elastic/fleet

@elastic/kibana-gis

@elastic/stack-monitoring

@elastic/obs-ux-infra_services-team

@elastic/obs-ai-assistant

@elastic/search-kibana

@elastic/kibana-security

@elastic/security-solution

@elastic/security-threat-hunting-investigations

@elastic/obs-ux-management-team

@mistic mistic changed the title upgrade typescript into v4.9.5 upgrade typescript into v5.1.6 Jun 19, 2024
@mistic mistic changed the title upgrade typescript into v5.1.6 chore(NA): upgrade typescript into v5.1.6 Jun 19, 2024
@mistic
Copy link
Member Author

mistic commented Jun 19, 2024

@elastic/kibana-core I believe @kbn/telemetry-tools would have to be fixed to work with TS v5, could you give me an help here please?

@afharo
Copy link
Member

afharo commented Jun 19, 2024

@mistic ack! I'll take a look today

@afharo
Copy link
Member

afharo commented Jun 19, 2024

My first look shows that the new version of TS changed the module resolution APIs. We need to adapt this section of the code for that:

const resolvedModule = (originalSource as any).resolvedModules.get(importedModuleName);
if (!resolvedModule) {
throw new Error(
`Import for [${importedModuleName}] in [${originalSource.fileName}] could not be resolved by TypeScript`
);
}
const resolvedModuleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName);

Unit tests in that package already highlight that, so it should be "easier" to iterate.

@mistic
Copy link
Member Author

mistic commented Jun 19, 2024

@afharo do you think something like what I've here it's okay?

@afharo
Copy link
Member

afharo commented Jun 19, 2024

@afharo do you think something like what I've here it's okay?

That's exactly what I was looking for! You are a real TS guru!

@mistic
Copy link
Member Author

mistic commented Jun 19, 2024

@elastic/ml-ui I think the schema extractor would have to also be updated to work properly on TS v5. I've skipped for now the jest tests that were failing here. I made some experiments but the unit tests keep getting different outputs from what you have there now and I didn't want to make more assumptions. Could you please take a look on it?

@elastic elastic deleted a comment from kibana-ci Jul 3, 2024
@elastic elastic deleted a comment from elasticmachine Jul 3, 2024
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner July 24, 2024 17:25
@mistic mistic merged commit 5859c69 into elastic:main Jul 29, 2024
6 of 10 checks passed
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jul 29, 2024

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 557.8KB 557.8KB +16.0B
cases 503.3KB 503.3KB +8.0B
data 48.0KB 48.0KB +7.0B
ml 4.6MB 4.6MB -24.0B
securitySolution 20.4MB 20.4MB +167.0B
stackConnectors 554.6KB 554.7KB +149.0B
transform 632.6KB 632.6KB +8.0B
triggersActionsUi 1.6MB 1.6MB +96.0B
visDefaultEditor 142.3KB 142.3KB +8.0B
visTypeHeatmap 9.8KB 9.8KB +2.0B
total +437.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.3MB 3.3MB +16.0B
stackConnectors 53.7KB 53.7KB +8.0B
total +24.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

mistic added a commit that referenced this pull request Aug 30, 2024
# Backport

This will backport the following commits from `main` to `8.15`:
- [chore(NA): upgrade typescript into v5.1.6
(#186437)](#186437)

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:skip This commit does not require backporting backported chore ci:project-deploy-observability Create an Observability project Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Obs AI Assistant Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team Team:Operations Team label for Operations Team v8.15.1 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.