Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose direct view plugins #17

Closed
wants to merge 1 commit into from
Closed

Propose direct view plugins #17

wants to merge 1 commit into from

Conversation

marijnh
Copy link
Member

@marijnh marijnh commented Aug 18, 2021

Allow plugins to be passed directly to the view, without storing them in the state.

See https://discuss.prosemirror.net/t/separating-state-and-view-plugins/3970

Rendered RFC

@ccorcos
Copy link

ccorcos commented Aug 25, 2021

Let's do it! 😄

marijnh added a commit to ProseMirror/prosemirror-view that referenced this pull request Aug 30, 2021
FEATURE: It is now possible to pass plugins directly to the view with
the `plugins` direct prop.

This implements ProseMirror/rfcs#17
@marijnh
Copy link
Member Author

marijnh commented Aug 30, 2021

Could you take a look at attached patch and let me know if it works for you?

@ccorcos
Copy link

ccorcos commented Sep 2, 2021

Hey, this looks good!

It took a minute to figure out how to apply the patch and rebuild locally:

cd prosemirror-view
git fetch --all
git diff ad436de  ffd8f3a8659ec7ae0ddeda81c31131d22d7b9536 > ../prosemirror-decouple-plugins/plugin.patch

cd ../prosemirror-decouple-plugins
cd node_modules/prosemirror-view
git init
git apply ../../plugin.patch
npm i
npm run build
rm -rf node_modules/prosemirror-*

But it works for me!

ccorcos/prosemirror-decouple-plugins@7b751d4

@marijnh
Copy link
Member Author

marijnh commented Sep 3, 2021

Merged as dcc9c84

@marijnh marijnh closed this Sep 3, 2021
@marijnh
Copy link
Member Author

marijnh commented Sep 3, 2021

Wonderful. Merged and released as part of prosemirror-view 1.20.0

@ccorcos
Copy link

ccorcos commented Sep 3, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants