Skip to content

Remove composition-api plugin & upgrade to vue 2.7 #1981

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

Merged
merged 5 commits into from
Jul 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,070 changes: 698 additions & 372 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions packages/vue/vue-vanilla/config/vue.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/dev/components/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { JsonForms, JsonFormsChangeEvent } from '../../config/jsonforms';
import { vanillaRenderers, mergeStyles, defaultStyles } from '../../src';
import '../../vanilla.css';
Expand Down
8 changes: 4 additions & 4 deletions packages/vue/vue-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"@types/chai": "^4.2.11",
"@types/jest": "^24.0.23",
"@types/mocha": "^5.2.4",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-unit-mocha": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/cli-plugin-babel": "~4.5.18",
"@vue/cli-plugin-typescript": "~4.5.18",
"@vue/cli-plugin-unit-mocha": "~4.5.18",
"@vue/cli-service": "~4.5.18",
"@vue/compiler-sfc": "^3.2.26",
"@vue/test-utils": "^2.0.2",
"chai": "^4.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/vue-vanilla/src/array/ArrayListElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</template>

<script lang="ts">
import { defineComponent, CompType } from '../../config/vue';
import { defineComponent, PropType } from 'vue';
import { classes, Styles } from '../styles';

const listItem = defineComponent({
Expand Down Expand Up @@ -76,7 +76,7 @@ const listItem = defineComponent({
},
styles: {
required: true,
type: Object as CompType<Styles, ObjectConstructor>
type: Object as PropType<Styles>
}
},
data() {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {
ControlElement,
schemaTypeIs
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import {
DispatchRenderer,
rendererProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
rankWith,
isBooleanControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
6 changes: 3 additions & 3 deletions packages/vue/vue-vanilla/src/controls/ControlWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<script lang="ts">
import { isDescriptionHidden, computeLabel } from '@jsonforms/core';
import { defineComponent, CompType } from '../../config/vue';
import { defineComponent, PropType } from 'vue';
import { Styles } from '../styles';
import { Options } from '../util';

Expand Down Expand Up @@ -42,7 +42,7 @@ export default defineComponent({
},
appliedOptions: {
required: false as false,
type: Object as CompType<Options, ObjectConstructor>,
type: Object as PropType<Options>,
default: undefined
},
visible: {
Expand All @@ -62,7 +62,7 @@ export default defineComponent({
},
styles: {
required: true,
type: Object as CompType<Styles, ObjectConstructor>
type: Object as PropType<Styles>
}
},
computed: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
rankWith,
isDateControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
rankWith,
isDateTimeControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
rankWith,
isEnumControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsEnumControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
rankWith,
isOneOfEnumControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsOneOfEnumControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
rankWith,
isIntegerControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
isMultiLineControl,
and
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
rankWith,
isNumberControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
rankWith,
isStringControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
rankWith,
isTimeControl
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl, RendererProps } from '../../config/jsonforms';
import { default as ControlWrapper } from './ControlWrapper.vue';
import { useVanillaControl } from '../util';
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/src/label/LabelRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
rankWith,
uiTypeIs
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import {
rendererProps,
RendererProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/src/layouts/GroupRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
isLayout,
uiTypeIs
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import {
DispatchRenderer,
rendererProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/src/layouts/LayoutRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
Layout,
rankWith
} from '@jsonforms/core';
import { defineComponent } from '../../config/vue';
import { defineComponent } from 'vue';
import {
DispatchRenderer,
rendererProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/src/styles/styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UISchemaElement } from '@jsonforms/core';
import { inject } from '../../config/vue';
import { inject } from 'vue';
import merge from 'lodash/merge';
import { defaultStyles } from './defaultStyles';

Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/src/util/composition.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useStyles } from '../styles';
import { computed, ref } from '../../config/vue';
import { computed, ref } from 'vue';
import merge from 'lodash/merge';
import cloneDeep from 'lodash/cloneDeep';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-vanilla/tests/unit/util/TestComponent.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { defineComponent } from '../../../config/vue';
import { defineComponent } from 'vue';
import { JsonForms } from '../../../config/jsonforms';
import { vanillaRenderers } from '../../../src';
import { JsonFormsChangeEvent } from '@jsonforms/vue';
Expand Down
11 changes: 0 additions & 11 deletions packages/vue/vue/config/config.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/vue/vue/config/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vue/vue/dev/renderers/ControlRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
JsonFormsRendererRegistryEntry,
rankWith
} from '@jsonforms/core';
import { defineComponent } from '../../config';
import { defineComponent } from 'vue';
import { rendererProps, useJsonFormsControl } from '../../src/';

const controlRenderer = defineComponent({
Expand Down
10 changes: 5 additions & 5 deletions packages/vue/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"main": "lib/jsonforms-vue.cjs.js",
"module": "lib/jsonforms-vue.esm.js",
"types": "lib/src/index.d.ts",
"types": "lib/index.d.ts",
"files": [
"lib/*",
"src/*"
Expand All @@ -51,10 +51,10 @@
"@jsonforms/core": "^3.0.0-beta.5",
"@rollup/plugin-alias": "^3.1.8",
"@types/jest": "^24.0.23",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-unit-jest": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/cli-plugin-babel": "~4.5.18",
"@vue/cli-plugin-typescript": "~4.5.18",
"@vue/cli-plugin-unit-jest": "~4.5.18",
"@vue/cli-service": "~4.5.18",
"@vue/compiler-sfc": "^3.2.26",
"@vue/test-utils": "^2.0.2",
"core-js": "^3.9.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue/src/components/DispatchCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script lang="ts">
import { defineComponent } from '../../config';
import { defineComponent } from 'vue';
import UnknownRenderer from './UnknownRenderer.vue';
import maxBy from 'lodash/maxBy';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue/src/components/DispatchRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script lang="ts">
import { defineComponent } from '../../config';
import { defineComponent } from 'vue';
import UnknownRenderer from './UnknownRenderer.vue';
import maxBy from 'lodash/maxBy';
import { rendererProps, useJsonFormsRenderer } from '../jsonFormsCompositions';
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue/src/components/JsonForms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script lang="ts">
import { PropType } from 'vue';
import { defineComponent } from '../../config';
import { defineComponent } from 'vue';
import {
coreReducer,
Actions,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue/src/components/UnknownRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script lang="ts">
import { defineComponent } from '../../config';
import { defineComponent } from 'vue';

export default defineComponent({
name: 'unknown-renderer'
Expand Down
30 changes: 13 additions & 17 deletions packages/vue/vue/src/jsonFormsCompositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import {
LabelElement
} from '@jsonforms/core';
import {
CompType,
PropType,
computed,
inject,
onBeforeMount,
onUnmounted,
ref
} from '../config';
} from 'vue';

/**
* Constructs a props declaration for Vue components which can be used
Expand All @@ -57,14 +57,13 @@ import {
export const rendererProps = <U = UISchemaElement>() => ({
schema: {
required: true as true,
type: [Object, Boolean] as CompType<
JsonSchema,
[ObjectConstructor, BooleanConstructor]
type: [Object, Boolean] as PropType<
JsonSchema
>
},
uischema: {
required: true as true,
type: Object as CompType<U, ObjectConstructor>
type: Object as PropType<U>
},
path: {
required: true as true,
Expand All @@ -77,14 +76,13 @@ export const rendererProps = <U = UISchemaElement>() => ({
},
renderers: {
required: false,
type: Array as CompType<JsonFormsRendererRegistryEntry[], ArrayConstructor>,
type: Array as PropType<JsonFormsRendererRegistryEntry[]>,
default: undefined
},
cells: {
required: false,
type: Array as CompType<
JsonFormsCellRendererRegistryEntry[],
ArrayConstructor
type: Array as PropType<
JsonFormsCellRendererRegistryEntry[]
>,
default: undefined
},
Expand Down Expand Up @@ -114,21 +112,19 @@ export const masterListItemProps = () => ({
},
schema: {
required: true as true,
type: [Object, Boolean] as CompType<
JsonSchema,
[ObjectConstructor, BooleanConstructor]
type: [Object, Boolean] as PropType<
JsonSchema
>
},
handleSelect: {
required: false as false,
type: Function as CompType<(index: number) => void, FunctionConstructor>,
type: Function as PropType<(index: number) => void>,
default: undefined
},
removeItem: {
required: false as false,
type: Function as CompType<
(path: string, value: number) => void,
FunctionConstructor
type: Function as PropType<
(path: string, value: number) => void
>,
default: undefined
}
Expand Down
Loading