- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 19
Labels
Pkg: parse-functionPriority: HighAfter critical issues are fixed, these should be dealt with before any further issues.After 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.It'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.Most issues will probably be for additions or changes. Expected that this will result in a PR.
Description
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
Labels
Pkg: parse-functionPriority: HighAfter critical issues are fixed, these should be dealt with before any further issues.After 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.It'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.Most issues will probably be for additions or changes. Expected that this will result in a PR.