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

Replace Webpack with Vite #1728

Merged
merged 31 commits into from
Dec 3, 2024
Merged

Replace Webpack with Vite #1728

merged 31 commits into from
Dec 3, 2024

Conversation

ryanmelt
Copy link
Member

No description provided.

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 38.88889% with 11 lines in your changes missing coverage. Please review.

Project coverage is 76.28%. Comparing base (29cd729) to head (bdfeda3).
Report is 39 commits behind head on main.

Files with missing lines Patch % Lines
...os-cmd-tlm-api/app/controllers/tools_controller.rb 0.00% 7 Missing ⚠️
openc3/lib/openc3/models/tool_model.rb 50.00% 3 Missing ⚠️
.../app/controllers/script_autocomplete_controller.rb 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1728      +/-   ##
==========================================
- Coverage   76.30%   76.28%   -0.03%     
==========================================
  Files         603      602       -1     
  Lines       46103    46088      -15     
  Branches      844      844              
==========================================
- Hits        35180    35157      -23     
- Misses      10827    10834       +7     
- Partials       96       97       +1     
Flag Coverage Δ
python 84.01% <ø> (+0.03%) ⬆️
ruby-api 48.60% <27.27%> (-0.11%) ⬇️
ruby-backend 82.13% <57.14%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jmthomas jmthomas left a comment

Choose a reason for hiding this comment

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

Mostly questions and clarifications. Look forward to a faster build and better support going foward with vite!

@@ -17,6 +17,10 @@ const config = {
tagline: 'OpenC3 COSMOS Documentation',
favicon: 'img/favicon.png',

future: {
experimental_faster: true,
},
Copy link
Member

Choose a reason for hiding this comment

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

This makes the build faster?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep. See the Docusaurus 3.6 release notes.

@@ -52,7 +52,7 @@ GEMS="$SCRIPT_DIR/../../../openc3-cosmos-init/plugins/gems/"
OPENC3_RELEASE_VERSION=5.21.0-beta0

mkdir -p ${GEMS}
cd ${PLUGINS}openc3-tool-base && yarn install && yarn run build && rake build VERSION=${OPENC3_RELEASE_VERSION} && mv *.gem ${GEMS}
cd ${PLUGINS}packages/openc3-tool-base && yarn run build && rake build VERSION=${OPENC3_RELEASE_VERSION} && mv *.gem ${GEMS}
Copy link
Member

Choose a reason for hiding this comment

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

Are we planning on deleting this hostinstall example?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought you already did that?
If not, then yes I want that removed for the 6.0 release.

elsif item['data_type'] == 'STRING'
default = "'#{item['default']}'" || ''
default = "'#{item['default']}'"
Copy link
Member

Choose a reason for hiding this comment

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

Was this to address a specific issue with BLOCK vs STRING?

Copy link
Member Author

Choose a reason for hiding this comment

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

That or never did anything so I removed it.

"@openc3/tool-common": "5.21.0-beta0",
"vue": "3.5.4",
"vuetify": "3.7.1"
"@openc3/tool-common": "5.21.0-beta0"
Copy link
Member

Choose a reason for hiding this comment

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

vue and vuetify go away because they're externals now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

resolve: {
extensions: [...DEFAULT_EXTENSIONS, '.vue'], // not recommended but saves us from having to change every SFC import
},
})
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to generate this vite config file now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Member

Choose a reason for hiding this comment

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

We should make a note to update all the templates to match the new Vue, Vuetify, and Vite syntax


defineCustomElements()

Object.getPrototypeOf(System).firstGlobalProp = true;
Copy link
Member

Choose a reason for hiding this comment

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

What does this do?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember the technical details, but it has to do with making systemjs work with Vue 3 since there's no global Vue anymore like there was with Vue 2. Vue 3 is just a module import

systemjs/systemjs#2272

},
],
})

router.beforeEach(({ path }) => {
if (['/', '/tools', '/tools/'].includes(path)) {
navigateToUrl(DEFAULT_TOOL_PATH)
singleSpaNavigate(DEFAULT_TOOL_PATH)
Copy link
Member

Choose a reason for hiding this comment

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

AppNav.vue does a bunch of navigateToUrl ... does it also need to change to singleSpaNavigate?

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I understand, they are interchangeable. It's just navigateToUrl has to be imported while singleSpaNavigate is just added as a global via the window object. I had changed them from singleSpaNavigate to navigateToUrl during the initial vue 3 migration stuff (while I was trying to get single-spa actually working), but that change should just be vestigial by now.

https://single-spa.js.org/docs/api/#navigatetourl

@@ -82,3 +82,15 @@ TOOL:
required: false
description: Regex to match against filenames. If match, then no ERB processing
values: .+
IMPORT_MAP_ITEM:
summary: Add an item to the import map
Copy link
Member

Choose a reason for hiding this comment

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

Can I get a description with a little more information about when and why this is needed?
"Needed for custom tools because ..."

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't currently needed. It will be needed when we go to a single import map to support ESM modules, but for now its just a neato feature that noone will use.

Copy link
Member

Choose a reason for hiding this comment

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

Ok ... let's remember to update the docs when we get to that point!

@@ -138,6 +139,9 @@ def __init__(
self.env = {} if env is None else env
self.container = container
self.prefix = prefix
self.shard = shard
if self.shard is None:
self.shard = 0
Copy link
Member

Choose a reason for hiding this comment

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

Does this shard stuff need migrations?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. It is upgrade safe.

parser,
f"Unknown keyword and parameters for Microservice: {keyword} {' '.join(parameters)}",
)
return None
Copy link
Member

Choose a reason for hiding this comment

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

Only the Ruby code processes the microservice model via the plugin_model. This must have been during my port everything to Python activity!

@ryanmelt ryanmelt merged commit 463ca20 into main Dec 3, 2024
27 of 28 checks passed
@ryanmelt ryanmelt deleted the vite branch December 3, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants