Skip to content

Conversation

wooorm
Copy link
Member

@wooorm wooorm commented Jun 14, 2019

Note: there are reservations for this approach: #47 (comment).

Closes GH-47.

/cc @Rokt33r

@wooorm wooorm requested a review from ChristianMurphy June 14, 2019 13:39
@wooorm
Copy link
Member Author

wooorm commented Jun 14, 2019

Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

I won't block this approach.
But I still do have reservations, and tend to think casting is a better solution.

@wooorm
Copy link
Member Author

wooorm commented Jun 14, 2019

I don’t have an informed enough opinion on this matter or TypeScript, so I’d abstain from voting for or against it: I created this PR based on a suggestion by @Rokt33r to continue the conversation.

I’m interested in hearing about the downsides from Junyoung.

@ChristianMurphy Is casting a solution we can apply here in unified, or does that happen on the user’s side?

@ChristianMurphy
Copy link
Member

Is casting a solution we can apply here in unified, or does that happen on the user’s side?

It would happen on the user's side, it's something we could document.

@wooorm
Copy link
Member Author

wooorm commented Jun 14, 2019

That doesn’t sound too bad...

@wooorm
Copy link
Member Author

wooorm commented Jun 15, 2019

@ChristianMurphy How should we document that? Here? https://github.com/unifiedjs/unified#returns-3

…maybe in also here? https://github.com/unifiedjs/unified#returns-6

…or should it go in *-react and the other stringifier plugins?

@ChristianMurphy
Copy link
Member

or should it go in *-react and the other stringifier plugins?

This option sounds good to me.
The custom type will be custom per plugin.

@Rokt33r
Copy link
Member

Rokt33r commented Jun 17, 2019

or should it go in *-react and the other stringifier plugins?

Should be ideal.

Until it is released, we could notice users to do like (processor.stringify(node, vfile) as unknown) as VNode. as @ChristianMurphy suggested in #47 (comment) rather than merging this pr.

@Rokt33r
Copy link
Member

Rokt33r commented Jun 17, 2019

@wooorm And I'm afraid that my decision is right because I'm not using remark with typescript now. My work is stale because I don't know which version of typescript should I support. remarkjs/remark#383 (comment)

If you give some kind of confirmation, I could start working again. In my opinion, we can ignore old versions of typescript until the type definitions for unified ecosystem are settled. spectrum: TypeScript version(s) supported?

@wooorm
Copy link
Member Author

wooorm commented Jun 18, 2019

Alright, I’ll close this PR.
We need a new PR closing GH-47 then, to add (processor.stringify(node, vfile) as unknown) as VNode to the docs here.

I’d appreciate if other people could do the same when needed to the other plugins returning non-strings.

My work is stale because I don't know which version of typescript should I support. remarkjs/remark#383 (comment)

Sorry about that. I don’t have an informed opinion. Going with current (3?) seems good to me? Thanks for working on types!

@wooorm wooorm closed this Jun 18, 2019
@wooorm wooorm deleted the allow-non-string-compiler branch June 18, 2019 15:24
@Rokt33r
Copy link
Member

Rokt33r commented Jun 18, 2019

I guess we need higher than v3.1 at least. Then, I'll ignore lower version support until types are settled to unified ecosystem! I could start working again from this weekend!

@wooorm
Copy link
Member Author

wooorm commented Jun 18, 2019

Awesome, sounds good to me!

wooorm added a commit that referenced this pull request Jun 25, 2019
wooorm pushed a commit to remarkjs/remark that referenced this pull request Jul 20, 2019
Related to unifiedjs/unified#53.
Related to unifiedjs/unified#54.
Related to unifiedjs/unified#56.
Related to unifiedjs/unified#57.
Related to unifiedjs/unified#58.
Related to unifiedjs/unified#59.
Related to unifiedjs/unified#60.
Related to unifiedjs/unified#61.
Related to unifiedjs/unified#62.
Related to unifiedjs/unified#63.
Related to unifiedjs/unified#64.
Related to #426.

Reviewed-by: Titus Wormer <tituswormer@gmail.com>
Reviewed-by: Junyoung Choi <fluke8259@gmail.com>
Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>

Co-authored-by: Junyoung Choi <fluke8259@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
@wooorm wooorm added ☂️ area/types This affects typings 👶 semver/patch This is a backwards-compatible fix 🙅 no/wontfix This is not (enough of) an issue for this project 🦋 type/enhancement This is great to have labels Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 🙅 no/wontfix This is not (enough of) an issue for this project 👶 semver/patch This is a backwards-compatible fix 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

Return type of stringify could be not a string
3 participants