-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: filter meta font json from render method #1522
fix: filter meta font json from render method #1522
Conversation
@@ -1,6 +1,8 @@ | |||
import './App.css'; |
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.
Why was this import moved?
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.
Sorry! vscode extensions messing things up
Mine is configured to sort 'near' imports early
directory/src/App.js
Outdated
</div> | ||
); | ||
const renderIcon = (family, name) => | ||
family.includes('_meta') ? null : ( |
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.
Can we change the script that generates this data instead?
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.
Pretty sure, fixing the script will be the best choice.
I don't touch the script because I can't understand it (why we need meta data and things like that). It's just a quick fix to make the icon search page become online again.
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.
AFAIK the meta files are needed to point to the correct font file, just like it's done for FA5: https://github.com/oblador/react-native-vector-icons/blob/master/directory/bin/generate-glyphmap-index.js So simply just copy paste FA5 and apply to FA6 would fix this issue
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.
ok, working on it
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.
ready for review
I returned the render method to original, and fixed the script that generates the glyphmaps, adding an exception if the file is a _meta, that was the source of the problem.
let me know if I need to change or improve something
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.
The _meta thing does nothing if the fix is applied correctly, so I removed it and fixed the logic condition 👍
What's the problem:
Library website with icons list stop rendering due an error on render method.
How i resolved:
The problem is the script that generates the glyphmaps, for some reason, the script that merge the files into one map json, is putting _meta json in too, and thats causes an exception on rendering function. I just filter the json property name if there's a family with "_meta" in the name. Probaly the script should be fixed, but I don't know exactly how things work here, so it's a quick solution.