Skip to content

Commit

Permalink
Remove vite-plugin-top-level-await plugin (#9038)
Browse files Browse the repository at this point in the history
We've used the vite-plugin-top-level-await to support top level await. But most of them were removed anyway, because the ide-desktop/lib/client is bundled as CJS and use some of gui2 code. And the plugin [is causing problems](Menci/vite-plugin-top-level-await#25), [also in our CI](https://github.com/enso-org/enso/actions/runs/7842841953/job/21402194728?pr=9013#step:8:458)
  • Loading branch information
farmaazon authored Feb 14, 2024
1 parent 5c7947c commit ee38136
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 153 deletions.
3 changes: 2 additions & 1 deletion app/gui2/e2e/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'enso-dashboard/src/tailwind.css'
import { createPinia } from 'pinia'
import { initializeFFI } from 'shared/ast/ffi'
import { createApp, ref } from 'vue'
import { mockDataHandler, mockLSHandler } from '../mock/engine'
import '../src/assets/base.css'
Expand Down Expand Up @@ -55,4 +56,4 @@ provideVisualizationConfig._mock(
},
app,
)
app.mount('#app')
initializeFFI().then(() => app.mount('#app'))
1 change: 0 additions & 1 deletion app/gui2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
"unbzip2-stream": "^1.4.3",
"vite": "^4.4.9",
"vite-plugin-inspect": "^0.7.38",
"vite-plugin-top-level-await": "^1.3.1",
"vitest": "^0.34.2",
"vue-react-wrapper": "^0.3.1",
"vue-tsc": "^1.8.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ import {
import type { AstId } from '@/util/ast/abstract'
import { unwrap } from '@/util/data/result'
import { tryIdentifier, tryQualifiedName } from '@/util/qualifiedName'
import { initializeFFI } from 'shared/ast/ffi'
import type { ExternalId, Uuid } from 'shared/yjsModel'
import { expect, test } from 'vitest'

await initializeFFI()

test.each([
['', 0, { type: 'insert', position: 0 }, {}],
[
Expand Down
4 changes: 1 addition & 3 deletions app/gui2/src/components/GraphEditor/GraphNode.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="ts">
<script setup lang="ts">
import { nodeEditBindings } from '@/bindings'
import CircularMenu from '@/components/CircularMenu.vue'
import GraphNodeError from '@/components/GraphEditor/GraphNodeError.vue'
Expand Down Expand Up @@ -38,9 +38,7 @@ const prefixes = Prefixes.FromLines({
skip: 'SKIP __',
freeze: 'FREEZE __',
})
</script>
<script setup lang="ts">
const props = defineProps<{
node: Node
edited: boolean
Expand Down
3 changes: 3 additions & 0 deletions app/gui2/src/providers/__tests__/widgetRegistry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import {
import { GraphDb } from '@/stores/graph/graphDatabase'
import { Ast } from '@/util/ast'
import { ApplicationKind, ArgumentInfoKey } from '@/util/callTree'
import { initializeFFI } from 'shared/ast/ffi'
import { describe, expect, test } from 'vitest'
import { defineComponent } from 'vue'
import type { PortId } from '../portInfo'
import { DisplayMode, argsWidgetConfigurationSchema } from '../widgetRegistry/configuration'

await initializeFFI()

describe('WidgetRegistry', () => {
function makeMockWidget<T extends WidgetInput>(
name: string,
Expand Down
3 changes: 3 additions & 0 deletions app/gui2/src/stores/graph/__tests__/graphDatabase.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { asNodeId, GraphDb } from '@/stores/graph/graphDatabase'
import { Ast, RawAst } from '@/util/ast'
import assert from 'assert'
import { initializeFFI } from 'shared/ast/ffi'
import { IdMap, type ExternalId } from 'shared/yjsModel'
import { expect, test } from 'vitest'

await initializeFFI()

/**
* Create a predictable fake UUID which contains given number in decimal at the end.
* @param x sequential value, e.g. 15
Expand Down
3 changes: 3 additions & 0 deletions app/gui2/src/util/ast/__tests__/aliasAnalysis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
import { assertDefined } from '@/util/assert'
import { AliasAnalyzer } from '@/util/ast/aliasAnalysis'
import { MappedKeyMap, MappedSet } from '@/util/containers'
import { initializeFFI } from 'shared/ast/ffi'
import { sourceRangeKey, type SourceRange } from 'shared/yjsModel'
import { expect, test } from 'vitest'

await initializeFFI()

/** The type of annotation. */
enum AnnotationType {
/** An identifier binding (introducing variable). */
Expand Down
3 changes: 0 additions & 3 deletions app/gui2/src/util/ast/aliasAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ import {
readTokenSpan,
} from '@/util/ast'
import { MappedKeyMap, MappedSet, NonEmptyStack } from '@/util/containers'
import { initializeFFI } from 'shared/ast/ffi'
import type { LazyObject } from 'shared/ast/parserSupport'
import { rangeIsBefore, sourceRangeKey, type SourceRange } from 'shared/yjsModel'

await initializeFFI()

const ACCESSOR_OPERATOR = '.'

const LAMBDA_OPERATOR = '->'
Expand Down
3 changes: 1 addition & 2 deletions app/gui2/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import postcssNesting from 'postcss-nesting'
import tailwindcss from 'tailwindcss'
import tailwindcssNesting from 'tailwindcss/nesting'
import { defineConfig, type Plugin } from 'vite'
import topLevelAwait from 'vite-plugin-top-level-await'
// @ts-expect-error
import * as tailwindConfig from '../ide-desktop/lib/dashboard/tailwind.config'
import { createGatewayServer } from './ydoc-server'
Expand All @@ -18,7 +17,7 @@ const IS_CLOUD_BUILD = process.env.CLOUD_BUILD === 'true'
// https://vitejs.dev/config/
export default defineConfig({
cacheDir: '../../node_modules/.cache/vite',
plugins: [vue(), gatewayServer(), topLevelAwait()],
plugins: [vue(), gatewayServer()],
optimizeDeps: {
entries: 'index.html',
},
Expand Down
143 changes: 0 additions & 143 deletions package-lock.json

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

0 comments on commit ee38136

Please sign in to comment.