#110 adds the minimum that would be needed to support an application that wants to implement serializing a compiled schema. This issue would add functions to the experimental API to handle serializing and deserializing instances of CompiledSchema. The compiled schema is mostly JSON-serializable, but has two types that require an extra step: RegExp and EvaluatedPlugin.
RegExp should be easy because it can be serialized as a string, but EvaluatedPlugin is a little more complicated. We'll have to store the plugin's identifier and use that to restore the plugin. That means we'll need to build something that can take a plugin identifier and return the plugin. That can be hardcoded for builtin plugins. For custom plugins, we'll have to include an additional argument to the restore function for the user to provide their custom plugins.
#110 adds the minimum that would be needed to support an application that wants to implement serializing a compiled schema. This issue would add functions to the experimental API to handle serializing and deserializing instances of
CompiledSchema. The compiled schema is mostly JSON-serializable, but has two types that require an extra step:RegExpandEvaluatedPlugin.RegExpshould be easy because it can be serialized as a string, butEvaluatedPluginis a little more complicated. We'll have to store the plugin's identifier and use that to restore the plugin. That means we'll need to build something that can take a plugin identifier and return the plugin. That can be hardcoded for builtin plugins. For custom plugins, we'll have to include an additional argument to the restore function for the user to provide their custom plugins.