-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
refactor(frontend): Migrate the frontend application from Vue.js 2 to 3 #2119
Conversation
👀 |
Thank you very much! 🙏 |
let spriteIndex = 0 | ||
// Load all the SVG symbols | ||
icons.keys().forEach((key, index) => { | ||
let result = icons(key) |
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.
Hi!
This code is return a base64 encoded content with the string "module.exports = ....", I guess is normal because we are using require.context.
So, at the end is reporting errors all code at line 15 because the regular expresions will return a null (then cannot be destruct from null).
I tested with a code like:
const base64Prefix = 'data:image/svg+xml;base64,'
if (result.startsWith(base64Prefix)) {
const positionPrefix = result.indexOf(base64Prefix) + base64Prefix.length
const base64Content = result.substring(positionPrefix)
result = atob(base64Content)
const regex = /module.exports = (.*)/.exec(result)
result = JSON.parse(regex[1])
}
before using the regular expression.
Description
EOF of Vue.js 2 is at the end of this year, so I tried to migrate to Vue 3.
Additional context
The PR has huge diffs and may be hard to review, and I try to separate each migration item into commits,
so that reviewing commit by commit is easier to read. Can you take a look at this? @Akryum
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).