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

feat: use modules instead of global bindings #3245

Merged

Conversation

chmelevskij
Copy link
Member

@chmelevskij chmelevskij commented Jan 15, 2023

  • Remove things attached to window global object.
  • Use esm imports for some of the node_modules.
  • Add new eslint rules. no-undef and no-duplicate-imports.
  • Move some of the helpers into their own files to avoid circular deps.
  • Fix few bugs which were using un existing variables.

@github-actions

This comment has been minimized.

@chmelevskij chmelevskij force-pushed the feat/remove-global-bindings branch from ca154fc to 688f06a Compare January 15, 2023 14:41
@github-actions

This comment has been minimized.

@chmelevskij chmelevskij force-pushed the feat/remove-global-bindings branch from 688f06a to 7475e37 Compare January 15, 2023 16:40
@chmelevskij chmelevskij marked this pull request as ready for review January 15, 2023 16:40
@haslinghuis haslinghuis added this to the 10.9.0 milestone Jan 15, 2023
@github-actions

This comment has been minimized.

@haslinghuis
Copy link
Member

Tested. Upon opening OSD tab:

osd.js:3234 Uncaught (in promise) TypeError: $(...).jBox is not a function
    at HTMLDivElement.<anonymous> (osd.js:3234:56)
    at Function.each (jquery.min.js:2:3003)
    at S.fn.init.each (jquery.min.js:2:1481)
    at osd.js:3233:35

@chmelevskij chmelevskij force-pushed the feat/remove-global-bindings branch from 7475e37 to d7c560f Compare January 15, 2023 17:04
@chmelevskij
Copy link
Member Author

@haslinghuis fixed now

@github-actions

This comment has been minimized.

@haslinghuis
Copy link
Member

🙃 getting same error 😋

@blckmn
Copy link
Member

blckmn commented Jan 15, 2023

I'd like to get this in and release RC5 ASAP (for the motors tab issue).

@chmelevskij I think this should be the last one done for 10.9. Anything else needs to be done in the next version please.

@blckmn
Copy link
Member

blckmn commented Jan 15, 2023

@chmelevskij in addition your new files are named using Snake Case. Please update to Camel Case. The bulk of the files are Camel Case already and you should maintain consistency.

For the next release I will update all files to be Camel Case.

@chmelevskij chmelevskij force-pushed the feat/remove-global-bindings branch from d7c560f to cc29263 Compare January 15, 2023 21:12
@chmelevskij
Copy link
Member Author

chmelevskij commented Jan 15, 2023

Update file names. I'll be working on some draft branch in the meantime.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.4% 0.4% Duplication

@github-actions
Copy link
Contributor

Do you want to test this code? Here you have an automated build:
Betaflight-Configurator-Android
Betaflight-Configurator-Linux
Betaflight-Configurator-macOS
Betaflight-Configurator-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

@haslinghuis
Copy link
Member

haslinghuis commented Jan 15, 2023

Problem is on 3rd line: uncaught (in promise) TypeError: $(...).jBox is not a function

                    // Generate tooltips for OSD elements
                    $('.osd_tip').each(function() {
                        OSD.data.tooltips.push($(this).jBox('Tooltip', {
                            delayOpen: 100,
                            delayClose: 100,
                            position: {
                                x: 'right',
                                y: 'center',
                            },
                            outside: 'x',
                        }));
                    });

EDIT: Fixed in https://github.com/betaflight/betaflight-configurator/pull/3248

@haslinghuis haslinghuis merged commit 771b840 into betaflight:master Jan 15, 2023
@wKich
Copy link

wKich commented Jan 17, 2023

Wow, that's awesome change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants