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

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

Open
noam-honig opened this issue Sep 26, 2024 · 9 comments
Open

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

noam-honig opened this issue Sep 26, 2024 · 9 comments
Labels
enhancement New feature or request pending triage

Comments

@noam-honig
Copy link
Contributor

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

@Nemikolh
Copy link
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?

@noam-honig
Copy link
Contributor Author

@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

@noam-honig
Copy link
Contributor Author

@Nemikolh I mean sounds perfect :)

@Nemikolh
Copy link
Member

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

@noam-honig
Copy link
Contributor Author

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

@noam-honig
Copy link
Contributor Author

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?

@Nemikolh
Copy link
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!

@AriPerkkio
Copy link
Member

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.

@AriPerkkio AriPerkkio added enhancement New feature or request pending triage labels Oct 14, 2024
@noam-honig
Copy link
Contributor Author

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
Labels
enhancement New feature or request pending triage
Projects
None yet
Development

No branches or pull requests

3 participants