Skip to content

Add an optional identifier to plugins #110

Description

@jdesrosiers

The original goal of the AST was for it be me fully JSON serializable. The one place I deviated from that goal was to allow RegExp values. This was to improve efficiency and it seemed reasonable because it's fairly easy to convert a RegExp to a string and back to JSON with builtin tools.

However, it didn't occur to me when I added the plugin system that I was adding something that isn't serializable. We need to figure out something to fix that.

I think the minimum we need to do is to give plugins an identifier. That would allow a hook for a JSON.stringify replacer to store something that can be used to restore the plugin. The application implementing serialization will need to maintain a plugin registry for the plugins they support mapping the identifier to the plugin, but that shouldn't be be challenging.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions