Skip to content

Option to use lesson solution as a template for next lesson #349

Open

Description

@noam-honig

Is your feature request related to a problem?

I have step by step tutorial, where the next step in many cases rely on the previous step (lesson)
I find my self creating templates that are copies of the solution of the previous step - and though that this could be simplified.

I'm using the .tk-config.json to only put changed files in that template - but still that template is a copy of the solution of the previous step

Describe the solution you'd like.

I wish I could refer to a lesson in the template: option of a lesson

Describe alternatives you've considered.

Create a lot of templates - less fun

Additional context

No response

Activity

  1. Nemikolh commented on Sep 26, 2024

    @Nemikolh
    Member

    Hey @noam-honig! This is a very good idea! I like it!

    Regarding how you refer to the previous lesson as a template, I'm thinking we could use a path like ../prev-lesson-folder.

    What do you think?

  2. noam-honig commented on Sep 26, 2024

    @noam-honig
    ContributorAuthor

    @Nemikolh Sounds prefer.

    A bit unrelated question - I hope it's ok, I'm having a wierd behavior around cookies with stackblitz, using cookie-session.
    I can easily reproduce it in this tutorial or a stackblitz project version of it, but reproducing it stand alone would take a long time.
    Is this something that's of interest - if so I'll spend the time

  3. noam-honig commented on Sep 26, 2024

    @noam-honig
    ContributorAuthor

    @Nemikolh I mean sounds perfect :)

  4. Nemikolh commented on Sep 26, 2024

    @Nemikolh
    Member

    Yes! That's definitely of interest! If you can share the stackblitz project, we'll have a look. 👍

  5. noam-honig commented on Sep 27, 2024

    @noam-honig
    ContributorAuthor

    Yes! That's definitely of interest! If you can share the stackblitz project, we'll have a look. 👍

    @Nemikolh thank you for that - i've been suffering from it for a while.

    I created a small reproduction of the issue, you can find it at:
    https://stackblitz.com/edit/stackblitz-starters-m9nszw?file=index.js

    You'll see how saving the user alex in the session works, and saving the user steve does not.

    Initially I said that I don't like steve and that's ok - but I saw that other things break the cookie as well
    This only happens in stackblitz - and I can see in the cookies section of the browser, that it seems that the result cookie is tempred with and breaks down - you can see that there is a weird date key, and that the signature is cleared for the values that don't work.

    Value with alex:
    image

    Value with steve:
    image

    Let me know if that's ok

  6. noam-honig commented on Oct 11, 2024

    @noam-honig
    ContributorAuthor

    Hey @noam-honig! This is a very good idea! I like it!

    Regarding how you refer to the previous lesson as a template, I'm thinking we could use a path like ../prev-lesson-folder.

    What do you think?

    Hi, @Nemikolh I think that this is a great idea - is there a timeline for it?

  7. Nemikolh commented on Oct 14, 2024

    @Nemikolh
    Member

    First, thanks a lot for the repro! This is a really odd bug. I've added it to our internal tracker for WebContainer. We will let you know when we have a fix 👍

    I think that this is a great idea - is there a timeline for it?

    I'm currently pretty busy with bolt and I'm not sure about @AriPerkkio. However if you want to take a stab at it, PRs are welcome!

  8. AriPerkkio commented on Oct 14, 2024

    @AriPerkkio
    Contributor

    I'm thinking we could use a path like ../prev-lesson-folder

    Where would this path be used? In .tk-config.json that is put in lesson's _files or _solution?

    Describe the solution you'd like.

    I wish I could refer to a lesson in the template: option of a lesson

    This is also pretty much same that #165 provides. A way to create re-usable files that are shown in lesson's editor.

  9. noam-honig commented on Oct 14, 2024

    @noam-honig
    ContributorAuthor

    I'm thinking we could use a path like ../prev-lesson-folder

    Where would this path be used? In .tk-config.json that is put in lesson's _files or _solution?

    Describe the solution you'd like.

    I wish I could refer to a lesson in the template: option of a lesson

    This is also pretty much same that #165 provides. A way to create re-usable files that are shown in lesson's editor.

    I think it differs from #165 since I don't want to show these files in the lesson - I want these files to actually be like template files - hidden - and I want to avoid the need to duplicate files - and maintain so many duplications.

    Today I find myself with templates that are called "solution_lession_x" that I use in lesson x+1

    As for the "where would this path be used?" I would use it in the template field in the lesson front-matter.

    The entire idea is not to duplicate files, and use them as templates in the next lesson.

    For example - conisder I'm building a full stack app - in the first lesson I've built the sign in mechanism - in the second lesson I do things with signed in users, I want the solution of the lesson about the sign in mechanizm to be used as the template for the lesson about doing things with them - without duplicating the files, and without showing them in the lesson editor (unless I specifically put them there)

    just like a template

    Sorry for the long text, I'm not sure I'm expressing myself clearly so I decided to elaborate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions