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

Optimize calc() usage in scss files #1158

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

ShatilKhan
Copy link
Contributor

Description

Optimization of some math equations inside calc() in scss files was done.

Issues Resolved

Fixes #1002

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • All tests pass
    • yarn lint
    • yarn test-unit
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Naurabay and others added 7 commits November 16, 2023 21:10
Signed-off-by: Nuraiym Omurbekova <nuraikaomurbek@gmail.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Also:
* Implement sass variable extraction
* Implement sass variable importing in typescript
* Add guards to post-install cleanup
* Make sources compatible with dart sass by wrapping divisions in `calc()` and adding units were necessary
* Fold in `@elastic/charts/dist/theme.scss` to modify it for dart-sass compatibility
* Break out compiling `charts`

Signed-off-by: Miki <miki@amazon.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
* typescript bump: 4.1.6

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* typescript bump: 4.2.4

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* typescript bump: 4.3.5

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* typescript bump: 4.4.4

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* typescript bump: 4.5.5

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* typescript bump: 4.6.4

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* CHANGELOG.md updated

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* bump typescript-eslint/eslint-plugin: 5.62.0
bump typescript-eslint/parser: 5.62.0

node 16 is required for typescript-eslint: 6.0.0

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* CHANGELOG.md update

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* move typescript update to regular section

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* changelog message improvement

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* fix typings

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* cleanup useUnknownInCatchVariables

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* logical or => nullish coalescing

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* wrap with String

Signed-off-by: Danila Gulderov <danila@gulderov.me>

* Update CHANGELOG.md

Move CHANGELOG entry to the unreleased section

Signed-off-by: Miki <miki@amazon.com>

* Add back `onPinClick` check in `OuiPinnableListGroup`

Update pinnable_list_group.tsx

Signed-off-by: Miki <miki@amazon.com>

* Enhance error message extraction in `validateFieldValue`

Update default_syntax.ts

Signed-off-by: Miki <miki@amazon.com>

* Remove e.code from default_syntax.ts

Update default_syntax.ts

Signed-off-by: Miki <miki@amazon.com>

* Lint default_syntax.ts

Signed-off-by: Miki <miki@amazon.com>

---------

Signed-off-by: Danila Gulderov <danila@gulderov.me>
Signed-off-by: Matt Provost <provomat@amazon.com>
Signed-off-by: Miki <miki@amazon.com>
Co-authored-by: Matt Provost <provomat@amazon.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
Co-authored-by: Miki <miki@amazon.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
On line 88, in order to optimize
We perform the subtraction within the map-get function directly.
This simplifies the calculation by removing the unnecessary parentheses around map-get($map, 'percentage').

Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
@ShatilKhan
Copy link
Contributor Author

These same kind of conflicts keep appeared in my previous PR
I'm curious about why this kind of conflict actually occurs?
image

<<<<<<< calc
=======
>>>>>>> main

What does this actually mean?

ShatilKhan and others added 7 commits November 17, 2023 16:58
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
@ShatilKhan
Copy link
Contributor Author

I'm just gonna make a new PR, a lot of problem with this one

@joshuarrrr
Copy link
Member

These same kind of conflicts keep appeared in my previous PR I'm curious about why this kind of conflict actually occurs? image

<<<<<<< calc
=======
>>>>>>> main

What does this actually mean?

@ShatilKhan Those lines indicate a merge conflict, where git is unsure whether which branch has the "correct" or desired changes. So it keeps both and wraps them in those markers so that you can manually choose (or replace with a combination). The first section is the line(s) as it appears in the calc branch and the second is the line as it appears in the main branch. See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts and https://code.visualstudio.com/docs/sourcecontrol/overview#_merge-conflicts

@ShatilKhan
Copy link
Contributor Author

Thanks for the explanation @joshuarrrr

@ShatilKhan ShatilKhan reopened this Dec 11, 2023
Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
@ShatilKhan
Copy link
Contributor Author

I resolved all the conflicts
This one is ready for review

@BSFishy
Copy link
Contributor

BSFishy commented Dec 12, 2023

Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Copy link
Contributor Author

@ShatilKhan ShatilKhan left a comment

Choose a reason for hiding this comment

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

fixed linting failures

Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
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.

Optimize calc() usage in scss files
6 participants