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

chore: remove vue/compat and complete Vue 3 migration #7133

Merged
merged 20 commits into from
Oct 19, 2023
Merged

chore: remove vue/compat and complete Vue 3 migration #7133

merged 20 commits into from
Oct 19, 2023

Conversation

ozyx
Copy link
Contributor

@ozyx ozyx commented Oct 10, 2023

Closes #7131

Describe your changes:

  • Removes vue/compat and related compatibility settings in our webpack config.
  • Upgrades to Vue 3 proper (3.3.4), completing the migration!
  • Removes usage of Vue in our unit tests
  • Replaces usage of $children in our unit tests with $refs

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

@ozyx ozyx added this to the Target:3.2.0 milestone Oct 10, 2023
@deploysentinel
Copy link

deploysentinel bot commented Oct 10, 2023

Current Playwright Test Results Summary

✅ 14 Passing

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/19/2023 04:08:24pm UTC)

Run Details

Running Workflow e2e-couchdb on Github Actions

Commit: 9581706

Started: 10/19/2023 04:03:04pm UTC

View Detailed Build Results


Current Playwright Test Results Summary

✅ 144 Passing - ⚠️ 2 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/19/2023 04:08:24pm UTC)

Run Details

Running Job e2e-stable on CircleCI

Commit: 9581706

Started: 10/19/2023 04:02:02pm UTC

⚠️ Flakes

📄   functional/plugins/conditionSet/conditionSet.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Basic Condition Set Use ConditionSet has correct outputs when telemetry is and is not available
Retry 1Initial Attempt
0% (0) 0 / 64 runs
failed over last 7 days
1.56% (1) 1 / 64 run
flaked over last 7 days

📄   functional/plugins/notebook/restrictedNotebook.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Restricted Notebook with a page locked and with an embed @addinit Disallows embeds to be deleted if page locked @addinit
Retry 1Initial Attempt
2.50% (1) 1 / 40 run
failed over last 7 days
40% (16) 16 / 40 runs
flaked over last 7 days

View Detailed Build Results


@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #7133 (a6ec502) into master (1414f54) will decrease coverage by 12.38%.
The diff coverage is n/a.

❗ Current head a6ec502 differs from pull request most recent head 9581706. Consider uploading reports for the commit 9581706 to get more accurate results

@@             Coverage Diff             @@
##           master    #7133       +/-   ##
===========================================
- Coverage   54.33%   41.96%   -12.38%     
===========================================
  Files         651      414      -237     
  Lines       26187    12868    -13319     
  Branches     2535        0     -2535     
===========================================
- Hits        14230     5400     -8830     
+ Misses      11256     7468     -3788     
+ Partials      701        0      -701     
Flag Coverage Δ
e2e-full 41.96% <ø> (+0.18%) ⬆️
e2e-stable ?
unit ?
Files Coverage Δ
src/api/menu/menu.js 93.10% <ø> (-3.45%) ⬇️
...rc/plugins/imagery/ImageryTimestripViewProvider.js 47.05% <ø> (-41.18%) ⬇️

... and 506 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1414f54...9581706. Read the comment docs.

@ozyx ozyx changed the title chore: remove Vue 2 compatibility layer chore: remove vue/compat and complete Vue 3 migration Oct 10, 2023
@ozyx ozyx added dependencies Pull requests that update a dependency file type:maintenance tests, chores, or project maintenance and removed dependencies Pull requests that update a dependency file labels Oct 10, 2023
@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 13, 2023
@@ -77,16 +77,17 @@ const config = {
MCT: path.join(projectRootDir, 'src/MCT'),
testUtils: path.join(projectRootDir, 'src/utils/testUtils.js'),
objectUtils: path.join(projectRootDir, 'src/api/objects/object-utils.js'),
utils: path.join(projectRootDir, 'src/utils'),
vue: path.join(projectRootDir, 'node_modules/@vue/compat/dist/vue.esm-bundler.js'),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove vue/compat alias

}
},
plugins: [
new webpack.DefinePlugin({
__OPENMCT_VERSION__: `'${packageDefinition.version}'`,
__OPENMCT_BUILD_DATE__: `'${new Date()}'`,
__OPENMCT_REVISION__: `'${gitRevision}'`,
__OPENMCT_BUILD_BRANCH__: `'${gitBranch}'`
__OPENMCT_BUILD_BRANCH__: `'${gitBranch}'`,
__VUE_OPTIONS_API__: true, // enable/disable Options API support, default: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to explicitly define these Vue compile time options, even if they're as defaults. Otherwise Vue generates a warning

@@ -20,7 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/

import Vue from 'vue';
import { nextTick } from 'vue';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vue was only available to us because of vue/compat. So now, only import the function itself

reorderEvent.newIndex,
oldComposition[reorderEvent.oldIndex]
);
this.ladTableObjects[reorderEvent.newIndex] = oldComposition[reorderEvent.oldIndex];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use $set anymore-- and it's been removed in Vue 3

@@ -78,6 +78,7 @@
<!-- Save Styles -->
<toolbar-button
v-if="canSaveStyle"
ref="saveStyleButton"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these refs so we can access them in the unit tests instead of using $children (which has been removed)

@@ -410,7 +410,7 @@ export default {
this.manageEmbedLayout();
this.timestampAndUpdate();
},
convertMarkDownToHtml(text) {
convertMarkDownToHtml(text = '') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a default of empty string here as this was sometimes undefined and causing issues. Still not sure why

@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 13, 2023
class="c-search__input"
aria-label="Search Input"
tabindex="10000"
type="search"
:value="value"
@input="handleInput"
@click="handleClick"
v-bind="$attrs"
Copy link
Contributor Author

@ozyx ozyx Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to bind $attrs here as well since $listeners was merged into it

Copy link
Contributor

@scottbell scottbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @ozyx! Did some cursory testing and looks great - really nice to not have any warnings!

Screen.Recording.2023-10-16.at.6.18.02.PM.mov

So many test updates!

@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 17, 2023
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 17, 2023
@ozyx
Copy link
Contributor Author

ozyx commented Oct 17, 2023

I'd like to test this branch against VIPER before we merge this

@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 19, 2023
@ozyx ozyx enabled auto-merge (squash) October 19, 2023 15:59
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 19, 2023
@ozyx ozyx merged commit 43338f3 into master Oct 19, 2023
@ozyx ozyx deleted the mct7131 branch October 19, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Vue 2 compatibility layer
2 participants