Skip to content

Conversation

@sdalonzo
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e89da32) 94.46% compared to head (2b1c4f9) 93.86%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1440      +/-   ##
==========================================
- Coverage   94.46%   93.86%   -0.60%     
==========================================
  Files         214      144      -70     
  Lines        9549     9434     -115     
  Branches      638      612      -26     
==========================================
- Hits         9020     8855     -165     
- Misses        515      562      +47     
- Partials       14       17       +3     

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

@sdalonzo sdalonzo force-pushed the no-mo-lodash branch 5 times, most recently from 50a6ef4 to 3877634 Compare January 24, 2024 04:02
@sdalonzo sdalonzo force-pushed the no-mo-lodash branch 4 times, most recently from 87ab964 to dbdb2b1 Compare January 24, 2024 04:47

// Dumb way to skip text elements since they also can have an align prop
if (get(Node, 'openingElement.name.name', '').toLowerCase().includes('text')) {
if (Node?.openingElement?.name?.name?.toLowerCase()?.includes('text')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

(super-n-b) If that last name returns, toLowerCase() should work, no?

Suggested change
if (Node?.openingElement?.name?.name?.toLowerCase()?.includes('text')) {
if (Node?.openingElement?.name?.name?.toLowerCase().includes('text')) {

Comment on lines +2 to +5
return string
.replace(/([a-z])([A-Z])/g, '$1-$2')
.replace(/[\s_]+/g, '-')
.toLowerCase()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function doesn't return exactly the same results as lodash's version, but I'm not sure how true to the original we need to be. The most obvious difference is that hyphens can end up leading or trailing characters -- is it worth an enhancement to trim that?
Screenshot 2024-01-24 at 7 15 24 AM
Screenshot 2024-01-24 at 7 16 10 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch! it's a naive copy from the internet, first goal was to get it building and measure the bundle change

VISIBLE_SLIDES_BREAKPOINT_1,
VISIBLE_SLIDES_BREAKPOINT_2,
} from './constants'
import debounce from 'lodash.debounce'
Copy link
Collaborator

Choose a reason for hiding this comment

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

(n-b) Kind of amazing that this was the only usage in DS

export function debounce(func, wait, immediate) {
let timeout
return function () {
const context = this
Copy link
Collaborator

Choose a reason for hiding this comment

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

(n-b) At least you didn't call it that 🤣


export function debounce(func, wait, immediate) {
let timeout
return function () {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't you need to spread the arguments into this function? I had assumed that this creates a new scope for the args setting below and comes up empty.

import PropTypes from 'prop-types'
import * as icons from './index'

function upperFirst(string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

(n-b) You've written this function twice -- the other instance is in utils
It's so small that repetition is probably fine, but do you want to consolidate?

* for your repo.
*/
"nodeSupportedVersionRange": ">=16",
"nodeSupportedVersionRange": ">=18",
Copy link
Collaborator

Choose a reason for hiding this comment

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

(n-b) This get missed in the v6 pull?

"@babel/core": "^7.22.15",
"@priceline/babel-preset": "workspace:*",
"@priceline/eslint-config": "workspace:*",
"@reach/component-component": "^0.16.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

(n-b) Oh, missed this one -- unused?

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