Skip to content

Next Major: Simplifying the API, docs and the plugins, smaller codebase, TypeScript support #65

Open
@tunnckoCore

Description

@tunnckoCore

What about that?

import { parse } from 'parse-function'

const pluginsArray = [
  (node, result) => {},
  (astNode, result) => {},
]

const result = parse(string|Function, parserOptions, pluginsArray)

// or without passing parser options
const result = parse(string|Function, pluginsArray)

We are just removing the extra step of creating "app" instance and then calling parse.
Also removing the use so called "smart plugins", we don't need to change anything to that "app" instance.

So now plugins are more simpler and flat, instead of (app) => (node, result) => {}

Should be noted that we can't just add plugins property to the parserOptions, because will conflict with babylon for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pkg: parse-functionPriority: HighAfter critical issues are fixed, these should be dealt with before any further issues.Status: AcceptedIt's clear what the subject of the issue is about, and what the resolution should be.Type: EnhancementMost issues will probably be for additions or changes. Expected that this will result in a PR.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions