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
Default clearScreen to false #2820
Comments
While I'm not using Svelte (for now 😄), I'll also upvote this. I also set |
It would seem to me that the issue lies within the Svelte config for Rollup. Would it not be prudent for that configuration to receive a minor update versus a breaking change (requiring a major version) in Rollup? |
Looks like this was quasi-fixed in #2942. Please give us a ping if there are still unresolved issues. |
#2942 still clears screen and "let's you scroll up" to see previous logs, but they are not the same or even not working. Example on mac: step 1) run rollup in non-watch mode and get console output: step 2) now run rollup in watch mode with Now I clear console, repeat step 1, remove Here I can't scroll up, it doesn't show previous logs (step 1 log, first execution step). The issue is that by default, watch mode clears screen every time and you can't find previous logs which can very useful (debug info, bundle size changes between compiling, db queries, etc). So, the real question is do we actually need to clear previous logs or make it harded to find them between rebuilds and why? As result, svelte adds clearScreen in rollup config in project template, many devs set it too. What about setting it to false by default and let devs set it to true or do we even need it? 🤔 |
Well this is damn peculiar. The character being sent for clearing the screen should allow scrolling up. You'd have to ask @Rich-Harris why clearing the screen was originally implemented, but I'd guess it was done to keep the current screen "clean," as watch+build output can get messy in a hurry. Perhaps we should take a different approach and allow consumers to clear the screen via a plugin+hook if they'd like to, and remove clearing the screen from core altogether. Thoughts @lukastaegert ? |
@shellscape yeah, at first I also thought it's a good thing to have clean screen during watch, a new build - a new life 😄 Later I understood that if I need info from previous builds (see db queries, compare errors, see bundle size changes, etc) I had to stop watch mode completely, find what I need and run it again. This is how I began to add clearScreen in all my rollup configs. On mac, cmd + K combination clears terminal, I feel it's more natural to use it because it works for every terminal command. I'm sure there should be similar combinations on linux and windows. After creating a ton of rollup configs with clearScreen I landed here :) |
It does in some way. I think it clears the currently visible part of the screen but anything above is still scrollable; some older logs always tend to be overwritten (The logs of the last run should still be available, though; need to check again if I find time). If someone finds a good solution so that we see a clean screen but do not lose any logs ever, please make a PR. I think at the moment we roughly do what Jest does. |
@lukastaegert how about setting clearScreen to false until a good enough working solution would be found? This screen clearing has been working strange for a long time, produced a quite a few issues and still has some. What do you think? 🤔 |
Came here as a Svelte newbie. I cannot say whether the change should be in Svelte / Rollup side, but the current behaviour does feel strange, especially since it seems I cannot completely opt-out of the screen clearing, can I? |
This is highly annoying--it erases output that might be important. You don't need to clear the screen. The option to suppress this behavior doesn't work. I vote to not clear the screen. |
Pardon me, it was sirv that was doing this, in Svlete, which uses both rollup and sirv by default. You can pass --no-clear to sirv (undocumented) to stop the behavior:
|
This!! Your'e a life saver. My issue was also caused by |
Hey! Looks like someone invited me to this issue. |
@givebk-bot !donate @johndunderhill $1 thanks for your solution ❤️ |
🎁 Hey @johndunderhill, you have just received U$ 1 from @nthypes!
@nthypes thanks for your support! ❤️
@johndunderhill, you can check your balance at https://givebk.io.
═══
(powered by https://givebk.io)
ID: aa70e47b-e9b5-49df-bfc5-7a2ea7f154b5
|
I use Sveltejs with Sirv and Rollup libs included as default.
Expected Behavior:
Running
npm run dev
should make both Sirv and Rollup output some infos to screen.Actual Behavior:
As soon as Sirv output infos, Rollup's infos covering it.
Proposal:
Please make Rollup's
clearScreen
default tofalse
.By defaulting to false,
(1) new user won't have to strugle finding out why and adding
watch: { clearScreen: false }
in Rollup config.(2) user can see what port Svelte's running.
I also have submitted this issue in Svelte Repo.
The text was updated successfully, but these errors were encountered: