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 TypeScript node16 and ESM #35

Merged
merged 4 commits into from Aug 21, 2022
Merged

Fix TypeScript node16 and ESM #35

merged 4 commits into from Aug 21, 2022

Conversation

alecmev
Copy link
Contributor

@alecmev alecmev commented Aug 21, 2022

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

See syntax-tree/mdast-util-mdxjs-esm#3.

syntax-tree/unist-util-visit-parents#12 needs to be merged and released before this PR.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 21, 2022
Copy link
Member

@wooorm wooorm left a comment

Choose a reason for hiding this comment

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

complex-types.d.ts Show resolved Hide resolved
wooorm pushed a commit to syntax-tree/unist-util-visit-parents that referenced this pull request Aug 21, 2022
Closes GH-12.
Related-to: syntax-tree/mdast-util-mdxjs-esm#3.
Related-to: syntax-tree/unist-util-visit#35.

Reviewed-by: JounQin <admin@1stg.me>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
@wooorm
Copy link
Member

wooorm commented Aug 21, 2022

@alecmev Ready to land I believe?

@alecmev alecmev marked this pull request as ready for review August 21, 2022 10:47
@alecmev
Copy link
Contributor Author

alecmev commented Aug 21, 2022

Now it is, needed to update unist-util-visit-parents.

@wooorm
Copy link
Member

wooorm commented Aug 21, 2022

needed to update

Does it fail without?

@alecmev alecmev changed the title Fix ESM Fix TypeScript node16 and ESM Aug 21, 2022
@wooorm wooorm merged commit 6742b2d into syntax-tree:main Aug 21, 2022
@wooorm wooorm added 🐛 type/bug This is a problem ☂️ area/types This affects typings 💪 phase/solved Post is done labels Aug 21, 2022
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Aug 21, 2022
@alecmev
Copy link
Contributor Author

alecmev commented Aug 21, 2022

needed to update

Does it fail without?

The build or tests don't fail, but the issue is there. Specifically, the visitor parameter of visitParents is any. It's a shame that no error is raised here, I don't know why import('./complex-types') fails silently.

Sorry if this has been addressed somewhere already, but why is this not written in plain TS? I think it would help with these kinds of problems, and make re-exports easier too. JSDoc feels claustrophobia-inducing.

@alecmev alecmev deleted the esm branch August 21, 2022 10:58
@wooorm
Copy link
Member

wooorm commented Aug 21, 2022

Thanks, released :)

@alecmev
Copy link
Contributor Author

alecmev commented Aug 21, 2022

Thank you! 😉

@wooorm
Copy link
Member

wooorm commented Aug 21, 2022

but why is this not written in plain TS

I like JavaScript because it works everywhere, right away. There are many other compile-to-whatever languages out there already.
I’ve had the experience of writing everything in CoffeeScript and rewriting everything again.
More people know how to write JavaScript than know TypeScript.
Tools come and go, the language remains

JSDoc feels claustrophobia-inducing.

That’s more of a thing with, well, complex types. In many places it’s all a lot simpler

fuxingloh pushed a commit to fuxingloh/contented that referenced this pull request Aug 22, 2022
This PR contains the following updates:



Package
Change
Age
Adoption
Passing
Confidence




unist-util-visit
^4.1.0 -> ^4.1.1








Release Notes

syntax-tree/unist-util-visit
v4.1.1
Compare Source

6742b2d Fix TypeScript node16 and ESM
by @​alecmev in syntax-tree/unist-util-visit#35
6789ad5 Add improved docs
d190ee7 Fix typo
by @​jangxyz in syntax-tree/unist-util-visit#34

Full Changelog: syntax-tree/unist-util-visit@4.1.0...4.1.1


Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.


 If you want to rebase/retry this PR, click this checkbox.


This PR has been generated by Mend Renovate. View repository job log here.

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@alecmev
Copy link
Contributor Author

alecmev commented Aug 22, 2022

Fair enough, thanks for the reply!

kodiakhq bot pushed a commit to X-oss-byte/Nextjs that referenced this pull request Oct 16, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [unist-util-visit](https://togithub.com/syntax-tree/unist-util-visit) | [`2.0.3` -> `5.0.0`](https://renovatebot.com/diffs/npm/unist-util-visit/2.0.3/5.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/unist-util-visit/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/unist-util-visit/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/unist-util-visit/2.0.3/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/unist-util-visit/2.0.3/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>syntax-tree/unist-util-visit (unist-util-visit)</summary>

### [`v5.0.0`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/5.0.0)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/4.1.2...5.0.0)

##### Change

-   [`4dcff31`](https://togithub.com/syntax-tree/unist-util-visit/commit/4dcff31) Update `@types/unist`
    **migrate**: update too
-   [`befc0b3`](https://togithub.com/syntax-tree/unist-util-visit/commit/befc0b3) Change to require Node.js 16
    **migrate**: update too
-   [`b5f36de`](https://togithub.com/syntax-tree/unist-util-visit/commit/b5f36de) Change to use `export` map
    **migrate**: don’t use private APIs
-   [`89fc050`](https://togithub.com/syntax-tree/unist-util-visit/commit/89fc050) Change to remove `complex-types.d.ts`
    **migrate**: use main export
-   [`12c9ee9`](https://togithub.com/syntax-tree/unist-util-visit/commit/12c9ee9) Change to pass `undefined`, not `null`
    **migrate**: change `null` to `undefined`

##### Fix

-   [`3cb2732`](https://togithub.com/syntax-tree/unist-util-visit/commit/3cb2732) Fix performance of `InclusiveDescendant` type

**Full Changelog**: syntax-tree/unist-util-visit@4.1.2...5.0.0

### [`v4.1.2`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/4.1.2)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/4.1.1...4.1.2)

##### Misc

-   [`332b6e0`](https://togithub.com/syntax-tree/unist-util-visit/commit/332b6e0) Add improved docs
-   [`754d038`](https://togithub.com/syntax-tree/unist-util-visit/commit/754d038) [`9f4813b`](https://togithub.com/syntax-tree/unist-util-visit/commit/9f4813b) Refactor code-style
-   [`69cbec6`](https://togithub.com/syntax-tree/unist-util-visit/commit/69cbec6) Update `tsconfig.json`

**Full Changelog**: syntax-tree/unist-util-visit@4.1.1...4.1.2

### [`v4.1.1`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/4.1.1)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/4.1.0...4.1.1)

-   [`6742b2d`](https://togithub.com/syntax-tree/unist-util-visit/commit/6742b2d) Fix TypeScript `node16` and ESM
    by [@&#8203;alecmev](https://togithub.com/alecmev) in [syntax-tree/unist-util-visit#35
-   [`6789ad5`](https://togithub.com/syntax-tree/unist-util-visit/commit/6789ad5) Add improved docs
-   [`d190ee7`](https://togithub.com/syntax-tree/unist-util-visit/commit/d190ee7) Fix typo
    by [@&#8203;jangxyz](https://togithub.com/jangxyz) in [syntax-tree/unist-util-visit#34

**Full Changelog**: syntax-tree/unist-util-visit@4.1.0...4.1.1

### [`v4.1.0`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/4.1.0)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/4.0.0...4.1.0)

-   [`a76200b`](https://togithub.com/syntax-tree/unist-util-visit/commit/a76200b) Add improved parent type
    by [@&#8203;wooorm](https://togithub.com/wooorm) in [syntax-tree/unist-util-visit#31

**Full Changelog**: syntax-tree/unist-util-visit@4.0.0...4.1.0

### [`v4.0.0`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/4.0.0)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/3.1.0...4.0.0)

-   [`050fdc3`](https://togithub.com/syntax-tree/unist-util-visit/commit/050fdc3) Change types to base what `visitor` gets on `tree`
    (**breaking** if you use TypeScript, read commit for info)

### [`v3.1.0`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/3.1.0)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/3.0.1...3.1.0)

-   [`5e98354`](https://togithub.com/syntax-tree/unist-util-visit/commit/5e98354) Add `VisitorResult` type

### [`v3.0.1`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/3.0.1)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/3.0.0...3.0.1)

-   [`a14d311`](https://togithub.com/syntax-tree/unist-util-visit/commit/a14d311) Fix example to use ESM

### [`v3.0.0`](https://togithub.com/syntax-tree/unist-util-visit/releases/tag/3.0.0)

[Compare Source](https://togithub.com/syntax-tree/unist-util-visit/compare/2.0.3...3.0.0)

-   [`ed0bccd`](https://togithub.com/syntax-tree/unist-util-visit/commit/ed0bccd) Add JSDoc based types
-   [`dfbcafb`](https://togithub.com/syntax-tree/unist-util-visit/commit/dfbcafb) Use ESM
    note: change from ~~`const visit = require('unist-util-visit')`~~ to `import {visit} from 'unist-util-visit'`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done 🐛 type/bug This is a problem
Development

Successfully merging this pull request may close these issues.

None yet

3 participants