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

broken non-html file editing and component behavior in general #892

Open
3 tasks
edenvidal opened this issue Dec 29, 2024 · 6 comments
Open
3 tasks

broken non-html file editing and component behavior in general #892

edenvidal opened this issue Dec 29, 2024 · 6 comments
Assignees

Comments

@edenvidal
Copy link
Member

edenvidal commented Dec 29, 2024

  • opening a comoponent (double clicking on a web compoent) redirects to the js file but it happens only once and never happen again.
  • let's trigger the reload action when saving any file that is referenced at the currently active page (great for js/svg etc.)
  • editing is lost when going to any non-html file and coming back to it.

need to clean and generalize the behvior to work with any file type at the bottom layer, and then there should be constrained rules for each file type, therfore html (it might be working this way already with some issues)

@edenvidal edenvidal converted this from a draft issue Dec 29, 2024
@edenvidal edenvidal moved this from In Progress to Next Up in rnbw 0.1 Dec 29, 2024
@edenvidal edenvidal changed the title broken component behavior broken non-html file editing and component behavior Jan 2, 2025
@edenvidal edenvidal changed the title broken non-html file editing and component behavior broken non-html file editing and component behavior in general Jan 2, 2025
@edenvidal
Copy link
Member Author

@atulbhatt-system32

@atulbhatt-system32
Copy link
Contributor

atulbhatt-system32 commented Jan 28, 2025

@edenvidal

I see this one issue with 3 different tasks independent of each other when it comest o solving them:

  1. This one is clear to me.
  2. This one is going to be very difficult as the process includes multiple process:
    • finding the files that are linked to current active page and create a mapping
    • track the changes only in these files which can be done from either rnbw or some external source
    • trigger reload without loosing other context such as selected element and more
  3. For this we might have to entirely change how we handle files with monaco

@edenvidal
Copy link
Member Author

edenvidal commented Feb 2, 2025

  1. great
  2. let's keep it simple. try using it a bit and see if we can trigger a reload automatically. let's also figure out the best way to do this for the user experience - that's the milestone. it doesn't matter how it triggers as long as its on the right time
  3. not sure why. it is a bug (not sure we're on the same page here)
    @atulbhatt-system32

@atulbhatt-system32
Copy link
Contributor

@edenvidal

  1. We can try it with simple test by identifying all the files that are linked to the current project and then triggering a reload when they change. So basically at a fixed interval we keep on changing if the state of these files are changed by fetching the content of those files repeatedly.

  2. It's a bug but it's a very complicated one. The handling of it becomes difficult because we treat html files in special because we show them on stage. Changing files triggers side effects which might be causing this.

So first step can be to debug and solve it. But if it doesn't give us consistent result than we can follow the approach below. We want to have generalised behaviour but html files are special in our case. We can even open web-component file preview while having html files. So it becomes complicated.

I said we might need to change how we handle files with monaco to simplify this special handling of special files like html.

When we spawn a editor using monaco it creates a model. So instead of having single model I think we can have atleast 2 models. One for html files and other for non-html files.

@edenvidal
Copy link
Member Author

  1. or we can trigger a change every time something changes. why? because when you're viewing an html file but editing a js file, you're expecting to see the effect of those changes in the active html file. see my point? so we can start there and move forward. the milestone is clear (;
  2. i now completely understand why this issue happens. so yes, this needs to be changed at a fundamental level to support, as you mentioned, two kinds of files. i’d even say not just html and non-html, but any file type. imagine in the future being able to edit markdown or svg files—who knows?

@edenvidal edenvidal moved this from Next Up to In Progress in rnbw 0.1 Feb 3, 2025
@atulbhatt-system32
Copy link
Contributor

  1. yes exactly @edenvidal I understand it.
  2. Yeah!

@edenvidal edenvidal moved this from In Progress to Next Up in rnbw 0.1 Feb 3, 2025
@edenvidal edenvidal moved this from Next Up to In Progress in rnbw 0.1 Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants