- When we add
Editor
toExtractedPluginSchema
the types fail for some reason. This isn't necessary to have everything work, but it likely falls into an important piece of technical debt. The reason why I think it's important is that there is no clear reason why it should be failing. Understanding this will probably be important for future typing errors. - Convert images to Markdown
- Convert attachments to Markdown
I've just come back from vacation in Korea and trying to rebuild my context.
Basically, what we are trying to do is make this slate-pluggable
project use the types from the project named plugin-types
. The goal here is to allow us to get, from the plugins, two things without having to define them separately:
- The
CustomTypes
for Slate - The plugins
You can see an example of this at: ~/projects/demos/plugin-types/src/index.tsx
Below is a list of changes that I need to make which I documented before I left for Korea. The instructions are a little sparse so I will have to rebuild my context as we go.
-
Stage 1: Switch unoptions plugins to use
TypedPlugin
- Added
schema-types
- Create a type definition for
TypedPlugin
which is the typed version ofBasePlugin
-
createPlugin
should return the typeBasePlugin
and notBasePluginFn
- Modify all plugins that don't have any
Options
to useTypedPlugin
- Added
-
Stage 2: Add ability to take
Options
atcreateSink
- ACKNOWLEDGE: We aren't going to take options at the
createSink
stage. It adds type complexity that has a low pay off and can introduce subtle bugs. If the developer wants to defaults, they can define aconst defaultOptions
and merge it in. - Add the
UploadPlugin
making sure we get proper initialization from the instance
- ACKNOWLEDGE: We aren't going to take options at the
-
Stage 3: Dependencies
createPlugin(fn, { deps: ... })
- At
createPlugin
, take an option likecreatePlugin(fn, { deps: 'upload'})
which means that this plugin has a dependency on theupload
plugin.
- At