unifiedjs / unified

☔️ interface for parsing, inspecting, transforming, and serializing content through syntax trees
https://unifiedjs.com
MIT License
4.49k stars 110 forks source link

Type errors on new major version → 11.0.2 #228

Closed philcockfield closed 1 year ago

philcockfield commented 1 year ago

Initial checklist

Affected packages and versions

unified@11.0.2, remark-parse@10.0.2

Link to runnable example

https://github.com/philcockfield/unified-type-error

Steps to reproduce

The sample repo above is a vanilla typescript setup with unified@11.0.2 and remark-parse added to show typescript type error.

The first 2 lines of the "getting started" sample on the Unified README are used to demonstrate the type error below, although other plugins that were successfully being used with the prior major version of unified@10.1.2 also produce similar type errors:

import { unified } from "unified";
import remarkParse from "remark-parse";

unified().use(remarkParse);

producing type error:

src/index.ts:4:15 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(preset?: Preset | null | undefined): Processor<undefined, undefined, undefined, undefined, undefined>', gave the following error.
    Type 'Plugin<[(Options | undefined)?], string, Root>' has no properties in common with type 'Preset'.

Expected behavior

Strongly typed as prior version (?? → I could not find any updated mentions in the unified README to setup types specially)

Actual behavior

The type error occurs at initial configuration of the pipeline:

image

Affected runtime and version

node@19

Affected package manager and version

npm@9.6.3

Affected OS and version

MacOS 13.4.1

Build and bundle tools

Vite

ChristianMurphy commented 1 year ago

Duplicate of https://github.com/unifiedjs/unified/issues/227

github-actions[bot] commented 1 year ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] commented 1 year ago

Hi! Thanks for taking the time to contribute!

Because we treat issues as our backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn’t an exact duplicate but is closely related.

Thanks, — bb

ChristianMurphy commented 1 year ago

The ecosystem is in the process of being updated. Hold on unified version 10 major until remark is updated.

philcockfield commented 1 year ago

Awesome - thanks guys. I'll sit tight!
Appreciate your beautiful work.