Skip to content

Commit 4c327bd

Browse files
committed
chore(deps): bump versions
1 parent 4a5e711 commit 4c327bd

File tree

8 files changed

+1292
-1255
lines changed

8 files changed

+1292
-1255
lines changed

.yarn/releases/yarn-4.3.1.cjs

Lines changed: 0 additions & 894 deletions
This file was deleted.

.yarn/releases/yarn-4.5.0.cjs

Lines changed: 925 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ plugins:
99
path: .yarn/plugins/@yarnpkg/plugin-nolyfill.cjs
1010
spec: "https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v1.0.2/bundles/@yarnpkg/plugin-nolyfill.js"
1111

12-
yarnPath: .yarn/releases/yarn-4.3.1.cjs
12+
yarnPath: .yarn/releases/yarn-4.5.0.cjs

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
},
1818
"dependencies": {
1919
"@codemirror-toolkit/extensions": "0.6.3",
20-
"@codemirror-toolkit/react": "0.6.0",
21-
"@codemirror-toolkit/utils": "0.5.0",
22-
"@codemirror/autocomplete": "6.18.0",
23-
"@codemirror/commands": "6.6.0",
20+
"@codemirror-toolkit/react": "0.7.1",
21+
"@codemirror-toolkit/utils": "0.5.1",
22+
"@codemirror/autocomplete": "6.18.1",
23+
"@codemirror/commands": "6.6.1",
2424
"@codemirror/language": "6.10.2",
2525
"@codemirror/search": "6.5.6",
2626
"@codemirror/state": "6.4.1",
@@ -38,38 +38,38 @@
3838
"rxjs": "8.0.0-alpha.14"
3939
},
4040
"devDependencies": {
41-
"@eslint/js": "9.9.1",
41+
"@eslint/js": "9.10.0",
4242
"@types/ackee-tracker": "5.0.4",
4343
"@types/eslint__js": "8.42.3",
44-
"@types/jest": "29.5.12",
45-
"@types/node": "22.5.1",
44+
"@types/jest": "29.5.13",
45+
"@types/node": "22.5.5",
4646
"@types/pako": "2.0.3",
47-
"@types/react": "18.3.4",
47+
"@types/react": "18.3.5",
4848
"@types/react-dom": "18.3.0",
4949
"@unocss/preset-web-fonts": "0.62.3",
5050
"@unocss/preset-wind": "0.62.3",
5151
"@unocss/transformer-directives": "0.62.3",
5252
"@unocss/transformer-variant-group": "0.62.3",
5353
"@vitejs/plugin-react": "4.3.1",
54-
"eslint": "9.9.1",
54+
"eslint": "9.10.0",
5555
"eslint-config-prettier": "9.1.0",
56-
"eslint-plugin-react": "7.35.0",
57-
"eslint-plugin-react-hooks": "5.1.0-rc-7771d3a7-20240827",
56+
"eslint-plugin-react": "7.36.1",
57+
"eslint-plugin-react-hooks": "5.1.0-rc-206df66e-20240912",
5858
"eslint-plugin-simple-import-sort": "12.1.1",
5959
"globals": "15.9.0",
6060
"jest": "29.7.0",
6161
"jest-environment-jsdom": "29.7.0",
6262
"prettier": "3.3.3",
6363
"ts-jest": "29.2.5",
6464
"ts-toolbelt": "9.6.0",
65-
"typescript": "5.5.4",
66-
"typescript-eslint": "8.3.0",
65+
"typescript": "5.6.2",
66+
"typescript-eslint": "8.5.0",
6767
"unocss": "0.62.3",
68-
"vite": "5.4.2",
69-
"vite-plugin-pwa": "0.20.1"
68+
"vite": "5.4.5",
69+
"vite-plugin-pwa": "0.20.5"
7070
},
7171
"resolutions": {
7272
"immer": "npm:mutative-compat@^0.1.0"
7373
},
74-
"packageManager": "yarn@4.3.1"
74+
"packageManager": "yarn@4.5.0"
7575
}

src/features/editor/CodeMirror.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,18 @@ import type { FC } from 'react'
22

33
import { classNames } from '@/common/utils'
44

5-
import { viewEffects } from './effects'
6-
import { useContainerRef, useViewEffect } from './hooks'
5+
import { effects } from './effects'
6+
import { setContainer, useViewEffect } from './hooks'
77

88
interface Props {
99
className?: string
1010
}
1111

1212
const CodeMirror: FC<Props> = ({ className }) => {
13-
const containerRef = useContainerRef()
14-
15-
useViewEffect((view) => {
16-
const cleanups = viewEffects.map((effect) => effect(view))
17-
return () => cleanups.forEach((cleanup) => cleanup?.())
18-
})
19-
13+
useViewEffect(effects)
2014
return (
2115
<div
22-
ref={containerRef}
16+
ref={setContainer}
2317
className={classNames('cursor-auto select-auto overflow-y-auto', className)}
2418
/>
2519
)

src/features/editor/effects.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Transaction } from '@codemirror/state'
22
import { addUpdateListener } from '@codemirror-toolkit/extensions'
3-
import type { ViewEffectSetup } from '@codemirror-toolkit/react'
3+
import { defineViewEffect } from '@codemirror-toolkit/react'
44
import { mapRangeSetToArray, rangeSetsEqual } from '@codemirror-toolkit/utils'
5-
import { debounceTime, filter, identity, map, of, switchMap } from 'rxjs'
5+
import { debounceTime, filter, map, of, switchMap } from 'rxjs'
66

77
import { store } from '@/app/store'
88
import { UPDATE_TIMEOUT_MS } from '@/common/constants'
@@ -30,8 +30,6 @@ import {
3030
import { isTemplate, templateSelection } from './examples'
3131
import { selectCurrentStatementLinePos } from './selectors'
3232

33-
const defineViewEffect = identity<ViewEffectSetup>
34-
3533
const resetAssemblerStateOnInput = defineViewEffect((view) => {
3634
const viewUpdate$ = onUpdate(view)
3735
return observe(
@@ -215,7 +213,7 @@ const toggleVimKeybindings = defineViewEffect((view) => {
215213
)
216214
})
217215

218-
export const viewEffects: readonly ViewEffectSetup[] = [
216+
const setups = [
219217
resetAssemblerStateOnInput,
220218
syncInputToState,
221219
syncInputFromState,
@@ -226,3 +224,8 @@ export const viewEffects: readonly ViewEffectSetup[] = [
226224
initialSyncBreakpointsFromState,
227225
toggleVimKeybindings,
228226
]
227+
228+
export const effects = defineViewEffect((view) => {
229+
const cleanups = setups.map((effect) => effect(view))
230+
return () => cleanups.forEach((cleanup) => cleanup?.())
231+
})

src/features/editor/hooks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createCodeMirror } from '@codemirror-toolkit/react'
1+
import { create } from '@codemirror-toolkit/react'
22
import { useEffect } from 'react'
33
import { debounceTime, filter, first, map, merge, switchMap } from 'rxjs'
44

@@ -20,12 +20,13 @@ import {
2020
setEditorMessage,
2121
} from './editorSlice'
2222

23-
export const { useViewEffect, useContainerRef } = createCodeMirror<HTMLDivElement>(() => {
23+
export const { useViewEffect, setContainer } = create((prevState) => {
2424
const editorInput = store.getState(selectEditorInput)
2525
const handleException: ExceptionHandler = (exception) => {
2626
store.dispatch(setException(exception))
2727
}
2828
return {
29+
state: prevState,
2930
doc: editorInput,
3031
extensions: [setup(), exceptionSink(handleException)],
3132
}

0 commit comments

Comments
 (0)