Skip to content
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

Switch from WebPack to Vite #1419

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
957e4a5
swapping python version to 3.11
BryonLewis Mar 4, 2024
df808b4
add libgdal-dev to CI
BryonLewis Mar 6, 2024
953fc91
gdal dependency adjustment
BryonLewis Mar 6, 2024
d8ff930
initial 3.11 python version
BryonLewis May 8, 2024
c99fd45
initial vue 2.7 upgrade working
BryonLewis May 9, 2024
f5564d3
resolving build issues
BryonLewis May 10, 2024
cf53fd5
Merge branch 'main' into python-311-update
BryonLewis May 10, 2024
bf01a70
updating tests
BryonLewis May 10, 2024
8a9f79f
reverting node builder
BryonLewis May 10, 2024
265fb46
removing vue template checker (vuetify issues)
BryonLewis May 10, 2024
f884901
removing template linting
BryonLewis May 10, 2024
d1be46a
updating vuetify version
BryonLewis May 14, 2024
2e8343f
linting
BryonLewis May 14, 2024
bae7baf
revert linting
BryonLewis May 20, 2024
6f159aa
lockfile
BryonLewis May 20, 2024
7ea1ab0
Merge branch 'main' into python-311-update
BryonLewis May 22, 2024
207a11e
initial vite conversion, vuetify plugin GWC issues
BryonLewis May 23, 2024
6cb0a93
Merge branch 'main' into python-311-update
BryonLewis May 24, 2024
e6cc9e3
linting
BryonLewis May 24, 2024
7b18e5c
resolving integration tests
BryonLewis May 28, 2024
6128c68
Merge branch 'main' into python-311-update
BryonLewis May 28, 2024
e99a578
Merge branch 'main' into python-311-update
BryonLewis Jun 3, 2024
d133dbe
adding getUsers script
BryonLewis Jun 3, 2024
04096f3
lint
BryonLewis Jun 3, 2024
654ef07
Merge branch 'python-311-update' into vite-process
BryonLewis Jun 4, 2024
5d75b7b
vite unplugin update
BryonLewis Jun 4, 2024
e9d3591
addressing review comments
BryonLewis Jun 4, 2024
f47717c
Merge branch 'python-311-update' into vite-process
BryonLewis Jun 4, 2024
928b5df
forgot to enable default-param-last eslint config
BryonLewis Jun 4, 2024
0b69342
Merge branch 'main' into vite-process
BryonLewis Jun 5, 2024
d9f945d
Merge branch 'vite-process' of github.com:Kitware/dive into vite-process
BryonLewis Jun 5, 2024
768caaf
Merge branch 'main' into vite-process
BryonLewis Jun 13, 2024
3ef084c
starting to utilize different vite configs for different builds
BryonLewis Jun 18, 2024
1769129
building updated
BryonLewis Jun 19, 2024
33a49c6
update base for the static paths
BryonLewis Jun 19, 2024
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
Prev Previous commit
Next Next commit
initial vue 2.7 upgrade working
BryonLewis committed May 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c99fd4583845de60d5ade9a07c0dc280cf061aab
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -22,10 +22,10 @@ jobs:
# "ref" specifies the branch to check out.
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted
ref: ${{ github.event.release.target_commitish }}
- name: Use Node 12
uses: actions/setup-node@v2
- name: Use Node 20
uses: actions/setup-node@v3
with:
node-version: '16.14.2'
node-version: '20.x'
# Specifies the registry, this field is required!
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
2 changes: 1 addition & 1 deletion client/dive-common/apispec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { provide } from '@vue/composition-api';
import { provide } from 'vue';
import { AnnotationId, StringKeyObject } from 'vue-media-annotator/BaseAnnotation';
import { GroupData } from 'vue-media-annotator/Group';

2 changes: 1 addition & 1 deletion client/dive-common/components/AttributeTrackFilter.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
/* eslint-disable max-len */
import { computed, defineComponent, ref } from '@vue/composition-api';
import { computed, defineComponent, ref } from 'vue';
import { throttle } from 'lodash';
import { useAttributes, useTrackFilters, useTrackStyleManager } from 'vue-media-annotator/provides';

20 changes: 10 additions & 10 deletions client/dive-common/components/Attributes/AttributeEditor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import {
computed, defineComponent, PropType, reactive, Ref, ref, watch,
} from '@vue/composition-api';
} from 'vue';
import { Attribute } from 'vue-media-annotator/use/AttributeTypes';
import { usePrompt } from 'dive-common/vue-utilities/prompt-service';
import { useTrackStyleManager } from 'vue-media-annotator/provides';
@@ -232,8 +232,8 @@ export default defineComponent({
>
<div style="word-break: break-word;">
{{
error ? error :
'Changes to Attribute Datatypes or Names do not effect \
error ? error
: 'Changes to Attribute Datatypes or Names do not effect \
currently set attributes on tracks.'
}}
</div>
@@ -245,21 +245,21 @@ export default defineComponent({
<v-text-field
v-model="baseSettings.name"
label="Name"
:rules="[v => !!v || 'Name is required', v => !v.includes(' ') ||
'No spaces', v => v !== 'userAttributes' || 'Reserved Name']"
:rules="[v => !!v || 'Name is required', v => !v.includes(' ')
|| 'No spaces', v => v !== 'userAttributes' || 'Reserved Name']"
required
/>
<v-select
:value="baseSettings.datatype"
:items="[
{ text: 'Boolean', value: 'boolean' },
{ text: 'Number', value: 'number' },
{ text: 'Text', value: 'text' }
{ text: 'Text', value: 'text' },
]"
label="Datatype"
@change="typeChange"
/>
<div v-if="baseSettings.datatype=== 'number'">
<div v-if="baseSettings.datatype === 'number'">
<v-radio-group
:value="(baseSettings.editor && baseSettings.editor.type) || 'combo'"
row
@@ -297,11 +297,11 @@ export default defineComponent({
v-model.number="baseSettings.editor.range[0]"
dense
outlined
:step="baseSettings.editor.range[0]> 1 ? 1 : 0.01"
:step="baseSettings.editor.range[0] > 1 ? 1 : 0.01"
type="number"
label="Min"
:rules="[
v => !isNaN(parseFloat(v))|| 'Number is required',
v => !isNaN(parseFloat(v)) || 'Number is required',
v => baseSettings.editor
&& baseSettings.editor.type === 'slider'
&& baseSettings.editor.range
@@ -315,7 +315,7 @@ export default defineComponent({
v-model.number="baseSettings.editor.range[1]"
dense
outlined
:step="baseSettings.editor.range[1]> 1 ? 1 : 0.01"
:step="baseSettings.editor.range[1] > 1 ? 1 : 0.01"
type="number"
label="Max"
:rules="[
10 changes: 5 additions & 5 deletions client/dive-common/components/Attributes/AttributeInput.vue
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import {
PropType,
onMounted,
watch,
} from '@vue/composition-api';
} from 'vue';
import { NumericAttributeEditorOptions, StringAttributeEditorOptions } from 'vue-media-annotator/use/AttributeTypes';

export default defineComponent({
@@ -143,7 +143,7 @@ export default defineComponent({
@keydown="onInputKeyEvent"
>
<input
v-else-if="datatype === 'number' && (!typeSettings || typeSettings.type ==='combo')"
v-else-if="datatype === 'number' && (!typeSettings || typeSettings.type === 'combo')"
ref="inputBoxRef"
:label="datatype"
:value="value"
@@ -155,15 +155,15 @@ export default defineComponent({
@keydown="onInputKeyEvent"
>
<div
v-else-if="datatype === 'number' && (typeSettings && typeSettings.type ==='slider')"
v-else-if="datatype === 'number' && (typeSettings && typeSettings.type === 'slider')"
>
<div class="slider-label">
{{ value }}
</div>
<v-slider
:value="value"
:step="typeSettings.steps ? typeSettings.steps
: (typeSettings.range[1] - typeSettings.range[0])/2.0"
: (typeSettings.range[1] - typeSettings.range[0]) / 2.0"
:min="typeSettings.range[0]"
:max="typeSettings.range[1]"
dense
@@ -182,7 +182,7 @@ export default defineComponent({
@keydown="onInputKeyEvent"
>
<option
v-for="(item,index) in boolOpts"
v-for="(item, index) in boolOpts"
:key="index"
:value="item.value"
>
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<script lang="ts">
import {
defineComponent, ref, PropType, Ref, watch, onMounted,
} from '@vue/composition-api';
} from 'vue';
import * as d3 from 'd3';
import { Attribute } from 'vue-media-annotator/use/AttributeTypes';

@@ -18,7 +18,6 @@ export default defineComponent({
setup(props, { emit }) {
const attributeColors: Ref<{key: number; val: string}[]> = ref([]);


const recalculateGradient = () => {
const linearGradient = d3.select('linearGradient');
const domain = attributeColors.value.map((item) => item.key);
@@ -96,7 +95,6 @@ export default defineComponent({
};
const gradientSVG: Ref<SVGElement | null> = ref(null);


watch(gradientSVG, () => {
const svg = d3.select('#gradient-image');
svg
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<script lang="ts">
import {
defineComponent, ref, PropType, watch, computed, reactive,
} from '@vue/composition-api';
} from 'vue';
import { useTrackFilters, useTrackStyleManager } from 'vue-media-annotator/provides';
import { Attribute, AttributeRendering } from 'vue-media-annotator/use/AttributeTypes';

@@ -371,7 +371,7 @@ export default defineComponent({
/>
<div
class="color-box mx-2 mt-5"
:class="{'edit-color-box': !displayNameSettings.displayColorAuto}"
:class="{ 'edit-color-box': !displayNameSettings.displayColorAuto }"
:style="{
backgroundColor: computedDisplayColor,
}"
@@ -418,7 +418,7 @@ export default defineComponent({
/>
<div
class="color-box mx-2 mt-5"
:class="{'edit-color-box': !valueSettings.valueColorAuto}"
:class="{ 'edit-color-box': !valueSettings.valueColorAuto }"
:style="{
backgroundColor: computedValueColor,
}"
@@ -531,7 +531,7 @@ export default defineComponent({
<div
v-if="boxSettings.box"
class="color-box mx-2 mt-5"
:class="{'edit-color-box': !boxSettings.boxColorAuto}"
:class="{ 'edit-color-box': !boxSettings.boxColorAuto }"
:style="{
backgroundColor: computedBoxColor,
}"
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<script lang="ts">
import {
defineComponent, ref, PropType, Ref,
} from '@vue/composition-api';
} from 'vue';
import { useStore } from 'platform/web-girder/store/types';
import { StringKeyObject } from 'vue-media-annotator/BaseAnnotation';
import { useCameraStore, useTrackStyleManager } from 'vue-media-annotator/provides';
@@ -23,7 +23,6 @@ export default defineComponent({
const store = useStore();
const user = (store.state.User.user?.login || '') as string;


const predeterminedValues = ref(props.attribute.values || []);

const attributeColors = ref(props.attribute.valueColors || {});
@@ -128,7 +127,7 @@ export default defineComponent({
<v-spacer />
</v-row>
<v-row
v-for="(val,key) in attributeColors"
v-for="(val, key) in attributeColors"
:key="val"
align="center"
justify="center"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import {
defineComponent, ref, watch, PropType,
} from '@vue/composition-api';
} from 'vue';

import StackedVirtualSidebarContainer from 'dive-common/components/StackedVirtualSidebarContainer.vue';
import { useReadOnlyMode } from 'vue-media-annotator/provides';
@@ -51,7 +51,6 @@ export default defineComponent({
});
</script>


<template>
<StackedVirtualSidebarContainer
:width="width"
@@ -66,7 +65,7 @@ export default defineComponent({
icon="mdi-filter"
tooltip-text="Filter Attributes displayed"
size="large"
:color="currentMode === 'Filtering'? 'primary' : 'default'"
:color="currentMode === 'Filtering' ? 'primary' : 'default'"
outlined
tile
@click="currentMode = 'Filtering'"
@@ -78,7 +77,7 @@ export default defineComponent({
tooltip-text="Chart Numeric Attributes"
size="large"
outlined
:color="currentMode === 'Timeline'? 'primary' : 'default'"
:color="currentMode === 'Timeline' ? 'primary' : 'default'"

tile
@click="currentMode = 'Timeline'"
23 changes: 10 additions & 13 deletions client/dive-common/components/Attributes/AttributesSubsection.vue
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import {
ref,
PropType,
computed,
} from '@vue/composition-api';
} from 'vue';
import {
useSelectedTrackId,
useCameraStore,
@@ -91,9 +91,7 @@ export default defineComponent({
if (selectedAttributes.value && selectedAttributes.value.attributes) {
attributeVals = selectedAttributes.value.attributes;
}
return sortAndFilterAttributes(
props.attributes, mode, attributeVals, sortingMode.value, additionFilters,
);
return sortAndFilterAttributes(props.attributes, mode, attributeVals, sortingMode.value, additionFilters);
});

const activeAttributesCount = computed(
@@ -108,8 +106,10 @@ export default defineComponent({
activeSettings.value = !activeSettings.value;
}

function updateAttribute({ name, value }: { name: string; value: unknown },
attribute: Attribute) {
function updateAttribute(
{ name, value }: { name: string; value: unknown },
attribute: Attribute,
) {
if (selectedTrackIdRef.value !== null) {
// Tracks across all cameras get the same attributes set if they are linked
const tracks = cameraStore.getTrackAll(selectedTrackIdRef.value);
@@ -125,9 +125,7 @@ export default defineComponent({
if (props.mode === 'Track') {
tracks.forEach((track) => track.setAttribute(name, updatedValue, user));
} else if (props.mode === 'Detection' && frameRef.value !== undefined) {
tracks.forEach((track) => track.setFeatureAttribute(
frameRef.value, name, updatedValue, user,
));
tracks.forEach((track) => track.setFeatureAttribute(frameRef.value, name, updatedValue, user));
}
}
}
@@ -164,7 +162,6 @@ export default defineComponent({
context.openClose('AttributesSideBar', true, 'Timeline');
}


function getAttributeValue(attribute: Attribute) {
if (selectedAttributes.value && selectedAttributes.value.attributes) {
if (!attribute.user) {
@@ -279,7 +276,7 @@ export default defineComponent({
icon="mdi-filter"
:color="filtersActive ? 'primary' : 'default'"
:tooltip-text="filtersActive
? 'Filters are active, click to view': 'No filters are active, click to edit'"
? 'Filters are active, click to view' : 'No filters are active, click to edit'"
@click="openFilter"
/>
<tooltip-btn
@@ -312,8 +309,8 @@ export default defineComponent({
>
<v-row
v-if="
activeSettings ||
selectedAttributes.attributes[attribute.name] !== undefined
activeSettings
|| selectedAttributes.attributes[attribute.name] !== undefined
"
class="ma-0"
dense
2 changes: 1 addition & 1 deletion client/dive-common/components/AutosavePrompt.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { defineComponent } from '@vue/composition-api';
import { defineComponent } from 'vue';

export default defineComponent({
name: 'AutosavePrompt',
8 changes: 3 additions & 5 deletions client/dive-common/components/ConfidenceFilter.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { defineComponent } from '@vue/composition-api';
import { defineComponent } from 'vue';
import { throttle, debounce } from 'lodash';

export default defineComponent({
@@ -23,10 +23,8 @@ export default defineComponent({
},
},
setup(props, { emit }) {
function _updateConfidence(event: InputEvent) {
function _updateConfidence(event: InputEvent & {target: {value: string}}) {
if (event.target) {
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
emit('update:confidence', Number.parseFloat(event.target.value));
}
}
@@ -51,7 +49,7 @@ export default defineComponent({
</span>
<span
:class="{'main-confidence':text ==='Confidence Threshold'}"
:class="{ 'main-confidence': text === 'Confidence Threshold' }"
>{{ text }}</span>
<v-spacer v-if="!$scopedSlots.default" />
<span class="pl-2">
2 changes: 1 addition & 1 deletion client/dive-common/components/ConfidenceSubsection.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import {
defineComponent, PropType,
} from '@vue/composition-api';
} from 'vue';

import {
useTrackStyleManager,
Loading