-
Notifications
You must be signed in to change notification settings - Fork 9
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
How to build without fontawesome pro licence? #155
Comments
BTW I removed the references to fontawesome pro (it seems you're only using it for some icons), but now when running npm run build I get ...\github\blmage\duolingo-solution-viewer\node_modules\rollup\dist\shared\loadConfigFile.js:480 SyntaxError: Unexpected token import Seems this might be a nodejs version issue though, will upgrade to the latest. |
Installed latest nodejs and now it gets stuck on src/ui.js → dist/src/ui.js... It was there a good 15 minutes, I killed it and reran "npm run build" but is just stuck there again. The process is node.exe with the command line When run with NODE_DEBUG=cluster,net,http,fs,tls,module,timers node app.js the last line in the output is MODULE 21764: Module._load REQUEST [...]\github\blmage\duolingo-solution-viewer\node_modules\param.macro\dist\index.js parent: [...]\github\blmage\duolingo-solution-viewer\node_modules\babel-plugin-macros\dist\index.js |
Left it running a couple of hours and finally got this: <--- Last few GCs ---> [13572:03E2FCA8] 5547895 ms: Mark-sweep (reduce) 1012.4 (1025.0) -> 1011.4 (1026.0) MB, 3411.1 / 0.0 ms (average mu = 0.102, current mu = 0.027) task scavenge might not succeed <--- JS stacktrace ---> FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory |
I must admit that I completely overlooked this when switching to the Font Awesome Pro packages, given all the benefits, and the fact that I did not really expect contributions (thanks for considering to!). Sorry, I don't have an answer right now, but I'll be thinking about it to try and find the best solution.
There is probably an unresolved import that remains somewhere. |
Why would an unresolved import cause that? E.g. before commenting out the references to FontAwesome pro I simply got errors that the import couldn't be found...
Do you have instructions for building at all?
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: blmage ***@***.***>
Sent: Thursday, May 6, 2021 10:06:41 PM
To: blmage/duolingo-solution-viewer ***@***.***>
Cc: wizofaus ***@***.***>; Author ***@***.***>
Subject: Re: [blmage/duolingo-solution-viewer] How to build without fontawesome pro licence? (#155)
Do I actually have a to purchase it to build this extension?
I must admit that I completely overlooked this when switching to the Font Awesome Pro packages, given all the benefits, and the fact that I did not really expect contributions (thanks for considering to!).
Sorry, I don't have an answer right now, but I'll be thinking about it to try and find the best solution.
It was there a good 15 minutes, I killed it and reran "npm run build" but is just stuck there again.
There is probably an unresolved import that remains somewhere.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#155 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABI5UAKB5TKGXFFUXDFFY3TTMKA5DANCNFSM44GBTGKQ>.
|
It looks like faKey, faThumbtack, faArrowFromLeft and faArrowToRight, are the only icons you needed from fontawesome pro - for now I've assigned this with existing free icons, cleaned out node_modules, rerun |
Alright, got it building and installed using
|
It's failing in sendMessageToBackground, chrome.runtime.sendMessage is setting chrome.runtime.lastError to { "message": "The message port closed before a response was received." }. I restored background.js back to what it was prior to my modifications and it seems OK now, looks like it had got corrupted/replaced when I was trying to reinitialize the project as a new chrome extension (hint: don't do that!) So I've finally got to where I wanted to get to, which is get all the raw data that's used to generate the solutions list dumped to the console. Definitely noticing some major issues for some lessons where there's 50MB events to parse, but I'm figuring it out as best I can - you're obviously far more patient than me trying to figure it all out from scratch! |
BTW one thing I did notice is that it seems that from (I can see now you're not using 'compactTranslations' at all, but the 'grader' information, which seems inordinately convoluted!) |
I'm not sure, but it's probably due to one of the Rollup plugins. Anyway, every time the build process hangs, it's because I forgot to
This seems to be especially true for solutions written in non-Latin alphabets, but so far it's been hard for me to figure out why / if it contains mostly irrelevant or redundant values / if there's anything we can do about it (I don't know or learn any of the corresponding languages) - your feedback would be very valuable here! For example, I had not yet considered this until now, but would parsing the Also, I remember finding "normalization data" in the You can run this code in the console if you want to take a look at it for Japanese e.g. :
|
From what I've seen, you can't get all accepted solutions from compactTranslations - but the ones you can't get are generally rubbish anyway that it makes no sense to use, I'm pretty sure it's all automatically generated, which is why some exercises have 100s of 1000s of accepted solutions. I'll do more investigation when I have time.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: blmage ***@***.***>
Sent: Friday, May 7, 2021 8:49:48 PM
To: blmage/duolingo-solution-viewer ***@***.***>
Cc: wizofaus ***@***.***>; Author ***@***.***>
Subject: Re: [blmage/duolingo-solution-viewer] How to build without fontawesome pro licence? (#155)
Why would an unresolved import cause that?
I'm not sure, but it's probably due to one of the Rollup plugins. Anyway, every time the build process hangs, it's because I forgot to npm i or to remove an obsolete import.
I can see now you're not using 'compactTranslations' at all, but the 'grader' information, which seems inordinately convoluted!
This seems to be especially true for solutions written in non-Latin alphabets, but so far it's been hard for me to figure out why / if it contains mostly irrelevant or redundant values / if there's anything we can do about it (I don't know or learn any of the corresponding languages) - your feedback would be very valuable here!
For example, I had not yet considered this until now, but would parsing the compactTranslations strings give solution lists that are sufficiently exhaustive? Knowing that this could be a perfect fallback for when a solution graph contains too many vertices.
Also, I remember finding "normalization data" in the localStorage, which seems to correspond to pairs of equivalent strings for non-Latin alphabets (again). Could most of the solutions actually correspond to different but equivalent combinations of (non-)normalized tokens?
You can run this code in the console if you want to take a look at it for Japanese e.g. :
JSON.parse(window.localStorage.getItem('duo.clientSideGradingConfig')).language_data['ja'].normalization_data;
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#155 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABI5UAOZG3QJQYKY2CXY2LTTMPAUZANCNFSM44GBTGKQ>.
|
Anyway, to anyone else wondering the same thing, yes, it's fine to build without using fontawesome-pro, you just need to remove the imports from package.json:
Then in ui.js, remove or comment out // import { faKey, faThumbtack } from 'react-icons/fa'; Then add window.faKey = faCheck just before So far I haven't noticed anywhere that this negatively affects the UI, but the obviously parts of this solution viewer that I haven't quite figured out yet (just from looking at the code it seems to have a lot more functionality than the bits I use). |
BTW don't suppose you've figured out a way to detect the URL of the discussion page? Each exercise seems to have an ID associated with it but I can never find it searching with DevTools among any of the source/network traffic/console output etc. |
The extension used to send requests to this URL (the same that is used when the "Discuss" button is clicked) to fetch the comment IDs:
in which
knowing that it can then use the |
Ok I have the extension logging out the discussionId value now but that's a long hex value like f58f2b8ab6198f612ed1b6c3b12b86bd. So far I haven't seen commentId anywhere, even though I added in logging to all the functions that work with it. |
Ok I get "commentId" logged out when I load the comments page. In fact it seems Duo doesn't even know what the "commentId" is when showing an exercise in a lesson, but uses some sort of redirection mechanism to bring up the forum page, which I'm trying to work out (actually it's not working for me at all at the moment for some reason). |
Which information do you have and what are you trying to find? |
Actually I tried with Edge (which doesn't support the plugin obviously), and I can see from its network traffic that when it fetches |
Basically I was just hoping to enhance the plugin to dump out useful summary information to the log about each lesson as I did it, and the forum discussion URL was one of the ones I definitely wanted, as often the "discuss" link doesn't even work. |
BTW deleting the _pxhd cookie in Chrome solved the 502 issue, Discuss button is now working. |
Interestingly if I click on the 'discuss' icon for an exercise that has no comments yet, it navigates to this URL instead: Visible in the browser address bar. And it seems there is no commentId assigned. |
I'm keen to build this extension myself to get a better idea of how it works and possibly add some additional features, but it seems I need an auth token for the fontawesome library? Do I actually have a to purchase it to build this extension? Why do I even need fontawesome, not clear why this extension would require something like that...
The text was updated successfully, but these errors were encountered: