Skip to content

Commit e3da8b9

Browse files
committed
import from 'effector/fork' should return effector itself
1 parent 0cf8c99 commit e3da8b9

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

src/evaluator/index.tsx

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,6 @@ const fetchForest = createEffect({
135135
return createRealm(text, `forest.cjs.js`, {effector})
136136
},
137137
})
138-
const fetchEffectorFork = createEffect({
139-
async handler(effector) {
140-
const url =
141-
'https://effector--canary.s3-eu-west-1.amazonaws.com/effector/fork.js'
142-
const sourceMap = `${url}.map`
143-
const req = await fetch(url)
144-
let text = await req.text()
145-
text = text.replace(
146-
/\/\/\# sourceMappingURL\=.*$/m,
147-
`//${tag}MappingURL=${sourceMap}`,
148-
)
149-
return createRealm(text, `fork.js`, {effector})
150-
},
151-
})
152138

153139
const fetchEffectorReactSSR = createEffect({
154140
async handler(effector) {
@@ -183,7 +169,6 @@ fetchBabelPlugin.fail.watch(() => selectVersion('master'))
183169

184170
const api = {
185171
effector: fetchEffector,
186-
'effector/fork': fetchEffectorFork,
187172
'@effector/babel-plugin': fetchBabelPlugin,
188173
forest: fetchForest,
189174
}
@@ -212,39 +197,36 @@ export async function evaluator(code: string) {
212197
])
213198
const effectorReact = await fetchEffectorReact(effector)
214199
let forest
215-
let effectorFork
216200
let effectorReactSSR
217201
let patronum
218202
if (version.getState() === 'master') {
219203
const additionalLibs = await Promise.all([
220204
fetchForest(effector),
221-
fetchEffectorFork(effector),
222205
fetchEffectorReactSSR(effector),
223206
fetchPatronum(effector),
224207
])
225208
forest = additionalLibs[0]
226-
effectorFork = additionalLibs[1]
227-
effectorReactSSR = additionalLibs[2]
228-
patronum = additionalLibs[3]
209+
effectorReactSSR = additionalLibs[1]
210+
patronum = additionalLibs[2]
229211
}
230212
const env = prepareRuntime(effector, effectorReact, version.getState())
231213
return exec({
232214
code,
233215
realmGlobal: getIframe().contentWindow,
234216
globalBlocks: [
235217
env, {
236-
dom: forest, forest, effectorFork, effectorReactSSR, patronum,
218+
dom: forest, forest, effectorFork: effector, effectorReactSSR, patronum,
237219
CodeMirror, cm: codeMirror,
238220
babel,
239221
generateBabelConfig: (plugins = []) => {
240222
const config = generateBabelConfig({types: null, filename: 'file'})
241223
config.plugins = [
242-
"transform-strict-mode",
243-
"syntax-bigint",
244-
"proposal-numeric-separator",
245-
"proposal-nullish-coalescing-operator",
246-
"proposal-optional-chaining",
247-
"effector/babel-plugin-react",
224+
"transform-strict-mode",
225+
"syntax-bigint",
226+
"proposal-numeric-separator",
227+
"proposal-nullish-coalescing-operator",
228+
"proposal-optional-chaining",
229+
"effector/babel-plugin-react",
248230
"@effector/repl-remove-imports",
249231
[availablePlugins['proposal-class-properties'], {loose: true}],
250232
[availablePlugins['effector/babel-plugin'], {addLoc: true}],

0 commit comments

Comments
 (0)