Skip to content

Commit

Permalink
fix: remove react dependency from wysiwyg-preset (remirror#1207)
Browse files Browse the repository at this point in the history
Commit remirror@9b8f766 had introduced a dependency from wysiwyg to the react-part of remirror. This removes this dependency again.
  • Loading branch information
ronnyroeller authored Sep 5, 2021
1 parent acf6ae1 commit edc898f
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-olives-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@remirror/preset-wysiwyg': minor
---

Remove react dependency from wysiwyg-preset: An earlier commit upgraded the tables from simple to fancy tables. As a side effect, this had introduced a dependency from wysiwyg to the react-part of remirror. This change removes this dependency again.
6 changes: 0 additions & 6 deletions packages/remirror__preset-wysiwyg/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,12 @@
{
"path": "../../remirror__extension-list/src"
},
{
"path": "../../remirror__extension-react-tables/src"
},
{
"path": "../../remirror__extension-search/src"
},
{
"path": "../../remirror__extension-strike/src"
},
{
"path": "../../remirror__extension-tables/src"
},
{
"path": "../../remirror__extension-trailing-node/src"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/remirror__preset-wysiwyg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@
"@remirror/extension-italic": "^1.0.3",
"@remirror/extension-link": "^1.0.3",
"@remirror/extension-list": "^1.0.10",
"@remirror/extension-react-tables": "^1.0.8",
"@remirror/extension-search": "^1.0.3",
"@remirror/extension-strike": "^1.0.3",
"@remirror/extension-tables": "^1.0.4",
"@remirror/extension-trailing-node": "^1.0.3",
"@remirror/extension-underline": "^1.0.3",
"@remirror/preset-core": "^1.0.5"
Expand Down
6 changes: 0 additions & 6 deletions packages/remirror__preset-wysiwyg/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,12 @@
{
"path": "../../remirror__extension-list/src"
},
{
"path": "../../remirror__extension-react-tables/src"
},
{
"path": "../../remirror__extension-search/src"
},
{
"path": "../../remirror__extension-strike/src"
},
{
"path": "../../remirror__extension-tables/src"
},
{
"path": "../../remirror__extension-trailing-node/src"
},
Expand Down
9 changes: 1 addition & 8 deletions packages/remirror__preset-wysiwyg/src/wysiwyg-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ import {
OrderedListExtension,
TaskListExtension,
} from '@remirror/extension-list';
import { TableExtension } from '@remirror/extension-react-tables';
import { SearchExtension, SearchOptions } from '@remirror/extension-search';
import { StrikeExtension } from '@remirror/extension-strike';
import { TableOptions } from '@remirror/extension-tables';
import { TrailingNodeExtension, TrailingNodeOptions } from '@remirror/extension-trailing-node';
import { UnderlineExtension } from '@remirror/extension-underline';

Expand All @@ -33,8 +31,7 @@ export interface WysiwygOptions
HeadingOptions,
LinkOptions,
SearchOptions,
TrailingNodeOptions,
TableOptions {}
TrailingNodeOptions {}

const DEFAULT_OPTIONS = {
...BidiExtension.defaultOptions,
Expand All @@ -44,7 +41,6 @@ const DEFAULT_OPTIONS = {
...SearchExtension.defaultOptions,
...TrailingNodeExtension.defaultOptions,
...HeadingExtension.defaultOptions,
...TableExtension.defaultOptions,
};

/**
Expand All @@ -63,7 +59,6 @@ export function wysiwygPreset(options: GetStaticAndDynamic<WysiwygOptions> = {})
const underlineExtension = new UnderlineExtension();
const blockquoteExtension = new BlockquoteExtension();
const codeExtension = new CodeExtension();
const tableExtension = new TableExtension();
const iframeExtension = new IframeExtension();
const bulletListExtension = new BulletListExtension();
const orderedListExtension = new OrderedListExtension();
Expand Down Expand Up @@ -139,7 +134,6 @@ export function wysiwygPreset(options: GetStaticAndDynamic<WysiwygOptions> = {})
blockquoteExtension,
codeBlockExtension,
headingExtension,
tableExtension,
iframeExtension,
bulletListExtension,
orderedListExtension,
Expand Down Expand Up @@ -169,7 +163,6 @@ export type WysiwygPreset =
| UnderlineExtension
| BlockquoteExtension
| CodeExtension
| TableExtension
| LinkExtension
| BidiExtension
| BoldExtension
Expand Down
3 changes: 3 additions & 0 deletions packages/remirror__react-editors/__e2e__/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
{
"path": "../../remirror__core-helpers/src"
},
{
"path": "../../remirror__extension-react-tables/src"
},
{
"path": "../../remirror__pm/src"
},
Expand Down
1 change: 1 addition & 0 deletions packages/remirror__react-editors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"dependencies": {
"@babel/runtime": "^7.13.10",
"@remirror/core-helpers": "^1.0.1",
"@remirror/extension-react-tables": "^1.0.8",
"@remirror/pm": "^1.0.2",
"@remirror/react": "^1.0.8",
"@remirror/styles": "^1.1.2",
Expand Down
2 changes: 2 additions & 0 deletions packages/remirror__react-editors/src/social/social-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
wysiwygPreset,
} from 'remirror/extensions';
import data from 'svgmoji/emoji.json';
import { TableExtension } from '@remirror/extension-react-tables';
import {
EditorComponent,
EmojiPopupComponent,
Expand Down Expand Up @@ -67,6 +68,7 @@ export const SocialEditor: FC<SocialEditorProps> = ({ placeholder, ...props }) =
const extensions = useCallback(
() => [
new PlaceholderExtension({ placeholder }),
new TableExtension(),
new MentionAtomExtension({
matchers: [
{ name: 'at', char: '@', appendText: ' ' },
Expand Down
3 changes: 3 additions & 0 deletions packages/remirror__react-editors/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
{
"path": "../../remirror__core-helpers/src"
},
{
"path": "../../remirror__extension-react-tables/src"
},
{
"path": "../../remirror__pm/src"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FC, useCallback } from 'react';
import { PlaceholderExtension, wysiwygPreset } from 'remirror/extensions';
import { TableExtension } from '@remirror/extension-react-tables';
import {
EditorComponent,
Remirror,
Expand All @@ -18,7 +19,7 @@ export interface WysiwygEditorProps {

export const WysiwygEditor: FC<WysiwygEditorProps> = ({ placeholder, ...props }) => {
const extensions = useCallback(
() => [new PlaceholderExtension({ placeholder }), ...wysiwygPreset()],
() => [new PlaceholderExtension({ placeholder }), new TableExtension(), ...wysiwygPreset()],
[placeholder],
);

Expand Down
6 changes: 2 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions support/root/.size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -753,10 +753,8 @@
"@remirror/extension-italic",
"@remirror/extension-link",
"@remirror/extension-list",
"@remirror/extension-react-tables",
"@remirror/extension-search",
"@remirror/extension-strike",
"@remirror/extension-tables",
"@remirror/extension-trailing-node",
"@remirror/extension-underline",
"@remirror/preset-core"
Expand Down

0 comments on commit edc898f

Please sign in to comment.