-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
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
feat: add multi file capabillity #38737
Conversation
07f4b8d
to
81858b5
Compare
I've been concentrating on the early HTML challenges, which it works nicely for. It also handles JavaScript challenges partially. If you click on the tab it shows the editor and everything works as expected, but it doesn't show by default (yet). React challenges are not handled at all, though it should be relatively easy to add support for them. |
@raisedadead Ideally I think /client should depend on /utils and /curriculum, but /curriculum should only depend on /utils. That way it should be easier to reason about and easier to drop in a new /client if and when that's desirable. So, as I've been going through this, I've been trying to disentangle /curriculum and /client a bit, putting various things in /utils. It's still a WIP, but my tentative plan is to cherry pick out those refactors into a separate PR, for ease of reviewing. Does that sound reasonable? |
658556a
to
de3af3e
Compare
Generates models to handle multiple groups of code (html, js or css) and tracks the editor state as user moves between tabs. The current model is connected to the redux store via a key associated with the file in the editor.
While this works for html challenges, it should dynamically generate the tabs in a predetermined order from the available files.
The editor should handle its own rendering. By including a key that changes as the users changes tabs forces the editor to re-render. This gets triggered as the user types, resetting the cursor to the start of the editor. Now the key only changes if the theme changes.
Since sort-files exists, the challengeFiles have an order. The editor now displays the first file on mount.
c4f91df
to
4d8cdfa
Compare
Checklist:
Update index.md
)master
branch of freeCodeCamp.