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

fix(module:icon): do not try to load SVG on the Node.js side since it will throw an error #7242

Closed
wants to merge 5 commits into from

Conversation

arturovt
Copy link
Member

@arturovt arturovt commented Feb 2, 2022

PR Checklist

PR Type

[x] Bugfix

What is the current behavior?

Issue Number: #7240

@zorro-bot
Copy link

zorro-bot bot commented Feb 2, 2022

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #7242 (84b00c7) into master (f40aad9) will decrease coverage by 0.01%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7242      +/-   ##
==========================================
- Coverage   91.72%   91.70%   -0.02%     
==========================================
  Files         486      486              
  Lines       15918    15921       +3     
  Branches     2588     2588              
==========================================
  Hits        14601    14601              
- Misses       1004     1007       +3     
  Partials      313      313              
Impacted Files Coverage Δ
components/icon/icon.service.ts 92.64% <50.00%> (-2.81%) ⬇️
components/icon/icon.directive.ts 95.77% <88.88%> (-1.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f40aad9...84b00c7. Read the comment docs.

// this SVG, so we'll have an unnecessary HTTP request on the server-side. There's no sense to
// call `_changeIcon()` when running the code on the Node.js side.
if (!this.platform.isBrowser) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

Should support changing icon when using static loading. I would provide an API in @ant-design/icons-angular to turn dynamic loading off.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, I'll make the changes after that.

@wzhudev
Copy link
Member

wzhudev commented Feb 8, 2022

@arturovt I made some changes. Not sure if we should change changeIcon2. It seems that all icons would be invisible if we skip the entire rendering process.

@arturovt
Copy link
Member Author

arturovt commented Feb 8, 2022

Alright, I'm ok with changes, seems like I have to revert tests.

Copy link
Member

@simplejason simplejason left a comment

Choose a reason for hiding this comment

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

LGTM

@nicholasgerard
Copy link

This seems to still be an issue in 13.1.0?

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.

None yet

5 participants