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

fix: enable downlevelIteration for es5 targets #2823

Merged
merged 3 commits into from
Mar 22, 2022

Conversation

legendecas
Copy link
Member

@legendecas legendecas commented Mar 9, 2022

Which problem is this PR solving?

The root tsconfig.json only compiles the basic, Node.js target product with the fix of #2765. Other compilation variants should also be tested in GitHub Actions.

Fixes #2821 (comment)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added

@codecov
Copy link

codecov bot commented Mar 9, 2022

Codecov Report

Merging #2823 (de6ba47) into main (2cb620d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2823   +/-   ##
=======================================
  Coverage   93.52%   93.52%           
=======================================
  Files         163      163           
  Lines        5572     5572           
  Branches     1180     1180           
=======================================
  Hits         5211     5211           
  Misses        361      361           

@legendecas legendecas force-pushed the metrics-ff/ci branch 2 times, most recently from 0e747b9 to f439147 Compare March 9, 2022 03:49
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "es5"
"target": "es5",
"downlevelIteration": true
Copy link
Member Author

@legendecas legendecas Mar 9, 2022

Choose a reason for hiding this comment

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

Though, Map/Set is available since ES2015. TypeScript doesn't introduce any polyfills for Map/Set. I think the es5-esm products we are publishing right now do not actually work for es5 environments without specific setups.

The good news is that the es5-esm products do not contain any fashion syntaxes (other than the ESM part) so that end-users do not need to transpile the otel-packages. They just need to include the polyfill packages. I believe this doesn't break the assumptions #2472 (comment).

@legendecas legendecas changed the title fix: run additional compilation variants fix: downlevelIteration is not enabled for es5 targets Mar 9, 2022
@legendecas legendecas changed the title fix: downlevelIteration is not enabled for es5 targets fix: enable downlevelIteration for es5 targets Mar 9, 2022
@legendecas legendecas marked this pull request as ready for review March 9, 2022 07:02
@legendecas legendecas requested a review from a team as a code owner March 9, 2022 07:02
@legendecas legendecas added this to In progress in Metrics SDK via automation Mar 9, 2022
Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

I believe all the duplicate compiles will drastically slow down our CI. Packages like core which are dependency of many packages may be compiled 10s of times if not over 100 times. Most of these compiles will be no-op because of incremental builds, but it is still quite some overhead.

@@ -76,6 +76,8 @@ jobs:
- name: Build 🔧
run: |
npm run compile
# run additional compilation variants
Copy link
Member

Choose a reason for hiding this comment

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

This is going to duplicate compile many many times because each package you run compile in also compiles its dependencies. This is why the compile is done from npm run compile to ensure everything is only compiled a single time.

Copy link
Member Author

Choose a reason for hiding this comment

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

The time spent is about 6minutes compared to about 2minutes before. And the full-compilation only happens in browser-tests -- Node.js tests only run the root tsconfig.json build.

Since these products are going to be released, we need to make sure the releasing variant is working so I think this is acceptable, WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

ah sorry I thought I already responded here. I think it's fine.

@legendecas legendecas requested a review from a team March 22, 2022 05:59
Metrics SDK automation moved this from In progress to Reviewer approved Mar 22, 2022
@legendecas legendecas merged commit 8182dab into open-telemetry:main Mar 22, 2022
Metrics SDK automation moved this from Reviewer approved to Done Mar 22, 2022
@legendecas legendecas deleted the metrics-ff/ci branch March 22, 2022 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants