-
Notifications
You must be signed in to change notification settings - Fork 183
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
[LOOM-1377][multiple-components]: remove unrequired ts ignores and address any typing issues #3392
Conversation
@@ -22,7 +22,7 @@ const ICONS_FOLDER_PATH = './node_modules/@skyscanner/bpk-svgs/dist/js/icons'; | |||
|
|||
gulp.task('copy', () => | |||
gulp | |||
.src(`${ICONS_FOLDER_PATH}/**/*.js`) | |||
.src(`${ICONS_FOLDER_PATH}/**/*`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need both the .d.ts
file and the .jsx
file.
Visit https://backpack.github.io/storybook-prs/3392 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3392 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3392 to see this build running in a browser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments. I have a concern on the level of changes to the snaps showing much different path values now. Do we know why that is?
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M19.113 8.095a1.496 1.496 0 010 2.008l-6.397 5.948a1 1 0 01-1.358.003l-6.532-6.01a1.427 1.427 0 01.138-1.949 1.572 1.572 0 011.997-.103l5.078 4.638 4.97-4.535a1.72 1.72 0 012.104 0z" | ||
d="M19.113 8.095a1.496 1.496 0 0 1 0 2.008l-6.397 5.948a1 1 0 0 1-1.358.003l-6.532-6.01a1.427 1.427 0 0 1 .138-1.949 1.57 1.57 0 0 1 1.997-.103l5.078 4.638 4.97-4.535a1.72 1.72 0 0 1 2.104 0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a path change like this to be a concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No concern, the diff is within an a
command: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#path_commands for drawing arcs. The previous parser/generator concatenated the large-arc-flag
and sweep-flag
(either 0
or 1
) and the new parser/generator does not. Both are valid and do not change the resulting svg viewed.
In addition I can see that some path values (1.572
) have been shortened (1.57
). My guess is that this is an optimisation step performed during generation & accuracy to 3 decimal places does not increase visual clarity so it is optimised away.
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M11.25 7.5a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5zm-3.588-.866a1.5 1.5 0 01-.358 2.09C5.597 9.933 4.5 11.89 4.5 14.092V19.5a1.5 1.5 0 11-3 0v-5.41c0-3.227 1.614-6.076 4.071-7.814a1.5 1.5 0 012.091.358zm7.176 0a1.5 1.5 0 012.09-.359C19.387 8.014 21 10.864 21 14.091v1.788l.44-.44a1.5 1.5 0 012.12 2.122l-3 3a1.5 1.5 0 01-2.12 0l-3-3a1.5 1.5 0 012.12-2.122l.44.44V14.09c0-2.201-1.097-4.159-2.804-5.366a1.5 1.5 0 01-.358-2.091z" | ||
d="M11.25 7.5a2.25 2.25 0 1 0 0-4.5 2.25 2.25 0 0 0 0 4.5m-3.588-.866a1.5 1.5 0 0 1-.358 2.09C5.597 9.933 4.5 11.89 4.5 14.092V19.5a1.5 1.5 0 1 1-3 0v-5.41c0-3.227 1.614-6.076 4.071-7.814a1.5 1.5 0 0 1 2.091.358m7.176 0a1.5 1.5 0 0 1 2.09-.359C19.387 8.014 21 10.864 21 14.091v1.788l.44-.44a1.5 1.5 0 0 1 2.12 2.122l-3 3a1.5 1.5 0 0 1-2.12 0l-3-3a1.5 1.5 0 0 1 2.12-2.122l.44.44V14.09c0-2.201-1.097-4.159-2.804-5.366a1.5 1.5 0 0 1-.358-2.091z" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -43,7 +43,7 @@ describe('BpkImage', () => { | |||
<BpkImage | |||
altText="image description" | |||
aspectRatio={816 / 544} | |||
style={{ width: spacingSm }} | |||
style={{ width: spacings.onePixelRem }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just put a bigger value in here? Concern here is that the tests may not catch any issues if its only 1rem in width
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test isn't visual, only testing that user values are placed onto the correct area of DOM, I can absolutely increase the value, however, it will provide no increase to the validity of the test.
"@skyscanner/bpk-foundations-web": "^17.11.0", | ||
"@skyscanner/bpk-svgs": "^19.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to bump these versions inside the packages/
folder so consumers will also be able to get these changes without issue too
Visit https://backpack.github.io/storybook-prs/3392 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3392 to see this build running in a browser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice looks good! I was investigating more about SVGs yesterday so it's quite good timing for this review.
…dress any typing issues (#3392) * remove unrequired ts ignores and address any typing issues * update test and snap * update lock file * update to all.tsx * update snaps * update inside packages too * update snaps
…dress any typing issues (#3392) * remove unrequired ts ignores and address any typing issues * update test and snap * update lock file * update to all.tsx * update snaps * update inside packages too * update snaps
Update packages to consume new typed svg and foundations.
Remember to include the following changes:
[KOA-123][BpkButton] Updating the colour
README.md
(If you have created a new component)README.md
.d.ts
) files updated