Skip to content
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

Closed

Conversation

moT01
Copy link
Member

@moT01 moT01 commented May 5, 2020

Checklist:

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the master branch of freeCodeCamp.
  • All the files I changed are in the same world language, for example: only English changes, or only Chinese changes, etc.

@gitpod-io
Copy link

gitpod-io bot commented May 5, 2020

@camperbot camperbot added language: English scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. labels May 6, 2020
@raisedadead raisedadead added platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. release: production type: feature request Threads classified to be feature requests. Implementation to be considered as a nice to have and removed language: English scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. labels May 13, 2020
@camperbot camperbot added language: English scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. labels May 15, 2020
@ojeytonwilliams ojeytonwilliams force-pushed the feat/allow-multifile-challenges branch from 07f4b8d to 81858b5 Compare May 28, 2020 16:43
@ojeytonwilliams
Copy link
Contributor

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.

@ojeytonwilliams
Copy link
Contributor

@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?

@ojeytonwilliams ojeytonwilliams force-pushed the feat/allow-multifile-challenges branch 3 times, most recently from 658556a to de3af3e Compare June 12, 2020 16:41
ojeytonwilliams and others added 11 commits June 17, 2020 15:46
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.
@ojeytonwilliams
Copy link
Contributor

Hey @moT01 to make things a little easier to manage, I've opened my own PR with these and a few more changes: #39223

@moT01 moT01 deleted the feat/allow-multifile-challenges branch July 10, 2020 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: feature request Threads classified to be feature requests. Implementation to be considered as a nice to have
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants