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

[zen-observable] Add 'zen-observable/esm' entry point #44468

Conversation

BenoitZugmeyer
Copy link
Contributor

zen-observable added a 'zen-observable/esm' entry point, exporting all code (index and extra) as an ES module. This PR add support for it.

Contrary to importing 'zen-observable', it doesn't expose the global namespace ZenObservable. Instead, I find it nicer to exports types directly.


  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/zenparsing/zen-observable/blob/master/esm.js
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • Include tests for your changes
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

@typescript-bot
Copy link
Contributor

typescript-bot commented May 4, 2020

@BenoitZugmeyer Thank you for submitting this PR!

This is a live comment which I will keep updated.

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

Status

  • ✅ No merge conflicts
  • ❌ Continuous integration tests have passed
  • ❌ Most recent commit is approved by DT maintainers

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This PR has been inactive for 31 days — it is considered abandoned!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 44468,
  "author": "BenoitZugmeyer",
  "owners": [
    "aicest",
    "JounQin",
    "itomtom"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "69ef3d9",
  "headCommitOid": "69ef3d9b14470cbc8bc25288531c2d12d9b3eea9",
  "mergeIsRequested": false,
  "stalenessInDays": 31,
  "lastPushDate": "2020-05-04T11:52:04.000Z",
  "lastCommentDate": "2020-07-07T07:01:50.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44468/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Critical",
  "anyPackageIsNew": false,
  "packages": [
    "zen-observable"
  ],
  "files": [
    {
      "path": "types/zen-observable/esm.d.ts",
      "kind": "definition",
      "package": "zen-observable"
    },
    {
      "path": "types/zen-observable/index.d.ts",
      "kind": "definition",
      "package": "zen-observable"
    },
    {
      "path": "types/zen-observable/test/esm.ts",
      "kind": "test",
      "package": "zen-observable"
    },
    {
      "path": "types/zen-observable/test/index.ts",
      "kind": "test",
      "package": "zen-observable"
    },
    {
      "path": "types/zen-observable/tsconfig.json",
      "kind": "package-meta-ok",
      "package": "zen-observable"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "missing",
  "lastReviewDate": "2020-05-18T23:02:47.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 0,
  "isChangesRequested": true
}

@typescript-bot
Copy link
Contributor

🔔 @aicest @JounQin @itomtom - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #44468 diff
Batch compilation
Memory usage (MiB) 35.9 30.8 -14.2%
Type count 2504 2795 +12%
Assignability cache size 265 292 +10%
Language service
Samples taken 156 216 +38%
Identifiers in tests 156 216 +38%
getCompletionsAtPosition
    Mean duration (ms) 70.8 73.2 +3.3%
    Mean CV 18.7% 16.3%
    Worst duration (ms) 101.1 108.4 +7.2%
    Worst identifier forEach Subscriber
getQuickInfoAtPosition
    Mean duration (ms) 70.4 74.3 +5.5%
    Mean CV 17.9% 17.0% -4.9%
    Worst duration (ms) 95.9 101.3 +5.7%
    Worst identifier subscribe subscribe

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label May 4, 2020
This commit add support for importing "zen-observable/esm".  Contrary to importing "zen-observable" directly, it
doesn't expose the global namespace ZenObservable.  Instead, it exports types directly.
@sandersn
Copy link
Contributor

This change looks reasonable to me, but I don't like merging changes to such a widely used package without some authors signing off.

@aicest @JounQin @itomtom
Can you take a look?

Copy link
Contributor

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

Needs experts sign off

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label May 18, 2020
@typescript-bot
Copy link
Contributor

@BenoitZugmeyer One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. If you disagree with the reviewer's comments, you can "dismiss" the review using GitHub's review UI. Thank you!

@BenoitZugmeyer
Copy link
Contributor Author

What can I do to help this PR moving forward?

@typescript-bot typescript-bot added the Check Config Changes a module config files label Jun 24, 2020
@typescript-bot
Copy link
Contributor

@BenoitZugmeyer I haven't seen any activity on this PR in more than 3 weeks, and this PR currently has problems that prevent it from being merged. The PR will be closed in a week if the issues aren't addressed.

@JounQin
Copy link
Contributor

JounQin commented Jul 7, 2020

Personally I'm not a fan of this, I think that a module property should be added instead into package.json of zen-observable.

There are a lot of packages which contains commonjs/esm entry at the same time, I don't think we should add two types files in favor of esModuleInterop option.

@BenoitZugmeyer
Copy link
Contributor Author

A PR is open to add the "module" field zenparsing/zen-observable#74

In the meantime, I don't think that's a discussion we should have here. I just adjusted types to follow the current upstream package API because I wanted to use it.

@typescript-bot typescript-bot removed the Check Config Changes a module config files label Jul 22, 2020
@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Aug 8, 2020
@typescript-bot
Copy link
Contributor

@BenoitZugmeyer To keep things tidy, we have to close PRs that aren't mergeable and don't have activity in the last month. No worries, though — please open a new PR if you'd like to continue with this change. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned This PR had no activity for a long time, and is considered abandoned Critical package Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Revision needed This PR needs code changes before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants