-
-
Notifications
You must be signed in to change notification settings - Fork 125
Synchronizing learn with curriculum during development #68
Comments
Hi @Flarp! I have a question for you.
If you make a change in curriculum repo then how do you get it to reflect in the learn repo? I currently change the files in node_modules to test the changes made in curriculum files. |
Whoops, my bad. Modify the |
@Flarp Great! Thanks for the tip. |
@Flarp, cool! That's way easier than modifying node_modules every time to test changes. Thanks! |
Glad to be helpful, but does anyone have a work around for this right now, where I can run each item in curriculum independent of learn? |
Hey @Flarp while this probably isn't exactly what you're after, hopefully it helps. You can avoid rebuilding learn by editing the Gatsby cache directly. First off get learn running via yarn develop. That should populate learn's .cache/json directory with the challenge data. Once you've found the file you want, you can just copy over any changes you want from curriculum and they'll appear when you reload that page. |
@ojeytonwilliams That should do it, I'll test that out soon (either tonight or tomorrow) and fill you in on how it goes, thank you! |
@Flarp you're very welcome! Definitely let me know how it goes. |
@ojeytonwilliams It works wonders! Thank you so much! |
Actually, this doesn't solve everything, the changes in |
@Flarp Indeed, it's far from a perfect solution. What I think would be ideal is if a change in I've been looking into this, and I'll keep you posted, but I haven't made great strides yet. |
@ojeytonwilliams My approach would be to use require.resolve() to locate the module directory (as said above, I don't use the default node_modules dir, as it's counter-intuitive for development), and then using some form of observable on the directory with Gatsby |
This line seems to already do what we want, it's simply commented out. I'll uncomment and get back to you on anything that occurs. |
Upon uncommenting (and a lot of other minor changes throughout both |
Indeed. The challenge plugin's a bit odd - it's based on the Nonetheless, I'll clean up what I have tomorrow and push it to my fork, so you can take a look. |
I'll push my fork too, show you the changes I've made |
Rather than 'require'ing challenges this reads them with fs, so they are no longer cached. As a result developers will not have to restart learn to see changes in curriculum. Also, the build:dev script skips the expensive minification step. ISSUES CLOSED: freeCodeCamp#68
Rather than 'require'ing challenges, read them directly with fs, which does not cache files. This allows learn to watch the files and rebuild when one changes. Also, the build:dev script skips the expensive minification step. ISSUES CLOSED: freeCodeCamp#68
It looks like we were going in similar directions. The key problems I encountered were that the json was being read with There's also weird issue with watches - Gatsby keeps trying to add them, and I've not figured out why. This doesn't break anything that I'm aware of, but it's troubling. Finally I thought it was a nice touch using require.resolve to get the |
A mind boggling error that came about during development was Vim creating copies of files (for saving purposes) faster than Node could read them, which caused You can read more about this oddity here (This isn't reflected in my codebase because I was directly editing I also disagree with removing the ignored options in the watcher, those files should not be reported to Gatsby when modified. |
Most of what we're doing actually pertains to the |
Should have thought of that. I figured that nothing needed ignoring, since
it was just looking at dist. Oh well, lesson learned!
…On Fri, 20 Jul 2018, 18:38 Flarp, ***@***.***> wrote:
A mind boggling error that came about during development was Vim creating
copies of files (for saving purposes) faster than Node could read them,
which caused learn to crash. I fixed this by adding the tilde (~) as a
character ignored by the watcher.
You can read more about this oddity (here)[
https://askubuntu.com/questions/173151/what-does-the-tilde-at-the-end-of-a-file-name-stand-for
]
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#68 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APEdzvVHglVrGS_dNSeW-9mRTYfIHjr6ks5uIgd9gaJpZM4U598V>
.
|
@Flarp So, I looked into this a bit more and it's a bit odd. Are you developing on a Mac, by any chance? For some reason, it seems that chokidar ignores vim's tmp files on Linux, but not on Mac. I'll make sure they're ignored regardless. As for the rest of the files, I agree they shouldn't be reported to Gatsby, but they also shouldn't be appearing in the dist directory in the first place! |
I am on Arch Linux, so that's strange. |
It is. Regardless, I think I've fixed the problem - by just watching .json files. Would you mind re-opening this? The changes span both |
Avoid caching challenges so that changes can be hotloaded into Gatsby. Add scripts to watch challenges and atomically copy them in the dist directory, without minification. ISSUES CLOSED: freeCodeCamp#68
Avoid caching challenges so that changes can be hotloaded into Gatsby. Add scripts to watch challenges and atomically copy them to the dist directory, without minification. ISSUES CLOSED: freeCodeCamp#68
Avoid caching challenges so that changes can be hotloaded into Gatsby. Add scripts to watch challenges and atomically copy them to the dist directory, without minification. ISSUES CLOSED: freeCodeCamp#68
Avoid caching challenges so that changes can be hotloaded into Gatsby. Add scripts to watch challenges and atomically copy them to the dist directory, without minification. ISSUES CLOSED: freeCodeCamp#68
Is your feature request related to a problem? Please describe.
On my computer, compiling learn takes several minutes (usually 5-10) and waiting this long to view a change with curriculum is just impractical when making minor adjustments.
Describe the solution you'd like
I'd like to be able to run something similar to
unpacked
, but there is an editor, and the learning tests (i.e buffer should be 64 bytes) can be run. It should not affect learn progress. This can be done by, when unpacking (maybe a different kind of unpack?), parsing thetests
section of the challenge, and converting it to the TAP test syntax. (I have no idea how that would be repacked, however. Probably some very structured comments, like the whole<!--description-->
stuff.)Describe alternatives you've considered
Testing it normally with learn, and using the unpacked version, but using the test suite to test pre-written code.
Additional context
My computer is rather old, so this is really just a convenience thing. Maybe I'm the only one who's developing with such a slow computer, and for everyone else, running learn takes a few seconds.
Many thanks.
The text was updated successfully, but these errors were encountered: