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

[babel] ensure TS preset runs before anything else #119107

Merged
merged 5 commits into from
Nov 29, 2021

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Nov 18, 2021

Fixes #118926

In order to support declare class properties the @babel/preset-typescript config needs to be executed first so that it can modify the AST for class properties before any other babel plugins. This required adopting new TS semantics around class property initializers (handled in #119130, #119227 and #119252) as well as upgrading storybook (handled in #119498) so that we can have the same support in storybooks unique babel config.

This also leads to the order of properties on objects created via classes being subtly different, which is unfortunate but it doesn't seem like we are depending on that anywhere.

As you can see in https://github.com/spalger/kibana/blob/implement/declare-support-ts/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx#L35 this is now functioning as of this PR.

@spalger spalger force-pushed the implement/declare-support-ts branch 7 times, most recently from c625624 to eb1d67a Compare November 22, 2021 18:57
@spalger spalger force-pushed the implement/declare-support-ts branch 3 times, most recently from dd109a5 to d5cfed8 Compare November 24, 2021 00:54
@spalger spalger force-pushed the implement/declare-support-ts branch from d5cfed8 to 3cf65f9 Compare November 24, 2021 20:32
@spalger spalger added release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v8.0.0 v8.1.0 v7.16.0 labels Nov 24, 2021
@spalger spalger marked this pull request as ready for review November 24, 2021 21:56
@spalger spalger requested review from a team as code owners November 24, 2021 21:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security unit test changes LGTM. We should really remove these inline snapshots 🙈

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stack management changes LGTM 👍

@spalger
Copy link
Contributor Author

spalger commented Nov 29, 2021

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 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
console 366.4KB 366.5KB +26.0B
dashboard 274.0KB 274.0KB -27.0B
total -1.0B

History

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

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presentation team changes LGTM! Nice to see the viewport type error which has been bugging me locally hopefully getting resolved!

@spalger spalger merged commit b2f5482 into elastic:main Nov 29, 2021
@spalger spalger deleted the implement/declare-support-ts branch November 29, 2021 18:29
@spalger spalger added the auto-backport Deprecated - use backport:version if exact versions are needed label Nov 29, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Nov 29, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
8.0
7.16 Commit could not be cherrypicked due to conflicts

Successful backport PRs will be merged automatically after passing CI.

To backport manually run:
node scripts/backport --pr 119107

kibanamachine added a commit that referenced this pull request Nov 29, 2021
spalger pushed a commit to spalger/kibana that referenced this pull request Nov 29, 2021
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	packages/kbn-storybook/src/webpack.config.ts
#	src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx
spalger pushed a commit that referenced this pull request Nov 29, 2021
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	packages/kbn-storybook/src/webpack.config.ts
#	src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.16.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support declare in babel configuration for Typescript
8 participants