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

[CLA Approved] feat: AMD -> ES6 #7029

Merged
merged 23 commits into from
Dec 27, 2023
Merged

[CLA Approved] feat: AMD -> ES6 #7029

merged 23 commits into from
Dec 27, 2023

Conversation

LeoDog896
Copy link
Contributor

@LeoDog896 LeoDog896 commented Sep 1, 2023

Fixes #6975, finishing a step for switching to an alternative ES6-only bundler like Vite.

(This is currently drafted as not all tests pass - there was weird ES6/AMD conversion hacks going on in the codebase).

This isn't a full refactor to ES6 classes and ESMified code. I've converted a few to classes when the files were small or when necessary (e.g. with the main MCT class), but I've tried to avoid many refactors and only focus on AMD -> ES6 conversion. If this PR is accepted, I'll probably lead up with a second PR to finish cleanup of the rest of the folder.

@LeoDog896
Copy link
Contributor Author

LeoDog896 commented Sep 1, 2023

Random tidbit but there seems to be some odd TS issue happening (there is a partial block by microsoft/TypeScript#55172), so I'll need to switch some functions into anonymous lambdas in the meantime.

@LeoDog896 LeoDog896 marked this pull request as ready for review September 1, 2023 17:51
@deploysentinel
Copy link

deploysentinel bot commented Sep 1, 2023

Current Playwright Test Results Summary

✅ 166 Passing - ⚠️ 3 Flaky

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

(Last updated on 12/27/2023 06:56:30pm UTC)

Run Details

Running Job e2e-stable on CircleCI

Commit: 9dfbdaf

Started: 12/27/2023 06:51:56pm UTC

⚠️ Flakes

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Tabs View Renders tabbed elements
Retry 1Initial Attempt
15.79% (6) 6 / 38 runs
failed over last 7 days
18.42% (7) 7 / 38 runs
flaked over last 7 days

📄   performance/tabs.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Tabs View Renders tabbed elements nicely
Retry 1Initial Attempt
6.90% (2) 2 / 29 runs
failed over last 7 days
3.45% (1) 1 / 29 run
flaked over last 7 days

📄   functional/planning/timelist.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Time List Create a Time List, add a single Plan to it and verify all the activities are displayed with no milliseconds
Retry 1Initial Attempt
0% (0) 0 / 40 runs
failed over last 7 days
67.50% (27) 27 / 40 runs
flaked over last 7 days

View Detailed Build Results


scarily small - can see why this e2e coverage issue is high priority
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Attention: 580 lines in your changes are missing coverage. Please review.

Comparison is base (715a448) 56.02% compared to head (9dfbdaf) 55.25%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7029      +/-   ##
==========================================
- Coverage   56.02%   55.25%   -0.78%     
==========================================
  Files         658      656       -2     
  Lines       26361    26617     +256     
  Branches     2546     2546              
==========================================
- Hits        14769    14707      -62     
- Misses      10893    11207     +314     
- Partials      699      703       +4     
Flag Coverage Δ *Carryforward flag
e2e-full 44.99% <66.66%> (+3.20%) ⬆️ Carriedforward from 3564a47
e2e-stable 58.11% <24.64%> (-0.44%) ⬇️
unit 48.83% <67.69%> (-0.34%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
example/generator/GeneratorMetadataProvider.js 100.00% <100.00%> (ø)
example/generator/SinewaveLimitProvider.js 100.00% <100.00%> (ø)
openmct.js 100.00% <100.00%> (ø)
src/MCT.js 96.96% <100.00%> (-0.36%) ⬇️
...c/plugins/URLIndicatorPlugin/URLIndicatorPlugin.js 100.00% <100.00%> (ø)
src/plugins/displayLayout/DisplayLayoutType.js 100.00% <100.00%> (ø)
src/plugins/filters/plugin.js 100.00% <100.00%> (ø)
src/plugins/flexibleLayout/plugin.js 100.00% <100.00%> (ø)
src/plugins/localTimeSystem/LocalTimeSystem.js 100.00% <ø> (ø)
src/plugins/localTimeSystem/plugin.js 100.00% <100.00%> (ø)
... and 64 more

... and 6 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 715a448...9dfbdaf. Read the comment docs.

@LeoDog896
Copy link
Contributor Author

Odd - that one failing playwright test seems to be very flaky. I ran it locally, and it failed the first time, and was successful the second time. Maybe it's a timing issue?

@ozyx
Copy link
Contributor

ozyx commented Sep 1, 2023

Hi @LeoDog896!

Thanks for contributing to Open MCT! If you haven't already, please complete and submit a Contributor License Agreement (CLA). This is required before we can approve/merge your code.

Odd - that one failing playwright test seems to be very flaky. I ran it locally, and it failed the first time, and was successful the second time. Maybe it's a timing issue?

Yep, that test is a current known flake, so likely not due to these changes.

If this PR is accepted, I'll probably lead up with a second PR to finish cleanup of the rest of the folder.

I think that's a good idea. This will take a while to review, and it's probably best to take care of large changes like this in manageable chunks. While we're waiting for your CLA to go through, please let us know if you have any questions or if we can assist in any way. Thanks again for this work!

@ozyx ozyx changed the title feat: AMD -> ES6 [CLA Needed] feat: AMD -> ES6 Sep 1, 2023
@ozyx ozyx added the source:community Community contribution or request label Sep 1, 2023
@ozyx
Copy link
Contributor

ozyx commented Oct 5, 2023

Hi @LeoDog896 ,

Thanks for your patience. We're still waiting to hear back about your CLA. I'll follow up with the folks in charge of that to see if we can get a status.

In the meantime, there have been quite a few changes since this PR was opened. Could you give a shot at resolving the resulting conflicts and let us know if you run into any issues?

@LeoDog896
Copy link
Contributor Author

LeoDog896 commented Oct 6, 2023

Sure! There shouldn't bee too many issues with merging; I'll resolve it in a bit.

@ozyx ozyx changed the title [CLA Needed] feat: AMD -> ES6 [CLA Pending] feat: AMD -> ES6 Oct 9, 2023
@ozyx ozyx changed the title [CLA Pending] feat: AMD -> ES6 [CLA Approved] feat: AMD -> ES6 Dec 19, 2023
@ozyx
Copy link
Contributor

ozyx commented Dec 19, 2023

@LeoDog896 At long last, I've received a follow-up about your CLA being approved! I'll give a shot at bringing this PR up to speed as it's been sitting here for a while. Really appreciate your patience on this one.

@LeoDog896
Copy link
Contributor Author

Alright, thanks! @ozyx, if you're not able to do it, then let me know - I completely forgot after saying my previous comment 😅

@ozyx ozyx added type:enhancement type:maintenance tests, chores, or project maintenance and removed type:enhancement labels Dec 21, 2023
src/api/objects/object-utils.js Dismissed Show resolved Hide resolved
src/plugins/autoflow/AutoflowTabularPlugin.js Show resolved Hide resolved
src/plugins/autoflow/AutoflowTabularView.js Show resolved Hide resolved
@LeoDog896
Copy link
Contributor Author

I'm not sure about the object-utils security issue mentioned above being a security issue, but 2 new (non-security) issues were caught because of the use of ES6.

@ozyx
Copy link
Contributor

ozyx commented Dec 22, 2023

I'm not sure about the object-utils security issue mentioned above being a security issue, but 2 new (non-security) issues were caught because of the use of ES6.

Yep, looks like the scanner is catching some more stuff now that we're using ES6. Awesome!

Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Really nice work! I've left a few suggestions, but this looks great overall. The tests are passing too! One thing I'd like to test is whether or not this changes how openmct is used as a dependency. I suspect it should remain very much the same, but I'd like to verify that before we go ahead with this.

src/api/objects/object-utils.js Dismissed Show resolved Hide resolved
src/api/api.js Outdated Show resolved Hide resolved
src/plugins/plugins.js Outdated Show resolved Hide resolved
src/plugins/plugins.js Outdated Show resolved Hide resolved
src/ui/registries/ViewRegistry.js Show resolved Hide resolved
src/ui/registries/ToolbarRegistry.js Show resolved Hide resolved
src/MCT.js Outdated Show resolved Hide resolved
src/MCT.js Show resolved Hide resolved
@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Dec 22, 2023
@ozyx
Copy link
Contributor

ozyx commented Dec 22, 2023

Really nice work! I've left a few suggestions, but this looks great overall. The tests are passing too! One thing I'd like to test is whether or not this changes how openmct is used as a dependency. I suspect it should remain very much the same, but I'd like to verify that before we go ahead with this.

Testing against our testing environment with openmct as a dependency and have had no issues at all. Fantastic

Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Couple additional suggestions

src/MCT.js Outdated Show resolved Hide resolved
src/MCT.js Outdated Show resolved Hide resolved
src/MCT.js Outdated Show resolved Hide resolved
@LeoDog896 LeoDog896 requested a review from ozyx December 23, 2023 01:48
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

This is looking great-- super excited to get this merged. Just one minor configuration fix

@LeoDog896
Copy link
Contributor Author

This is looking great-- super excited to get this merged. Just one minor configuration fix

👍, anything else?

@ozyx ozyx added pr:e2e:couchdb npm run test:e2e:couchdb and removed pr:e2e:couchdb npm run test:e2e:couchdb labels Dec 27, 2023
@ozyx ozyx self-requested a review December 27, 2023 20:12
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

LGTM

@ozyx ozyx merged commit 2e03bc3 into nasa:master Dec 27, 2023
20 of 26 checks passed
LeoDog896 added a commit to LeoDog896/openmct that referenced this pull request Dec 28, 2023
@LeoDog896 LeoDog896 mentioned this pull request Dec 28, 2023
15 tasks
ozyx pushed a commit that referenced this pull request Dec 28, 2023
* refactor: fix issues arose from #7029

* refactor: move replaceAll -> replace in makeKeyString

* fix: move order of escape to backslash first

* style: lint
@unlikelyzero unlikelyzero modified the milestones: Target:3.3.0, Target:4.0.0 Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:e2e:couchdb npm run test:e2e:couchdb source:community Community contribution or request type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update remaining AMD files to ES6 classes.
3 participants