-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: support multiple dev servers by using random temp directories #354
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since VuePress is still in the early iterations, I still think that the temp dirs should be in placed in local package's directory.
To support multiple temp dirs, you can simply suffixed the temp dir with a hash or timestamp for each instance.
yarn.lock
Outdated
@@ -6222,7 +6222,7 @@ tiny-emitter@^2.0.0: | |||
|
|||
tmp@^0.0.33: | |||
version "0.0.33" | |||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" | |||
resolved "http://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shouldn't be included here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, forget to add -g
when change the registry
Changed to local package's dir. |
I wonder why would we need to spawn multiple dev servers? |
Same question, why would we need to spawn multiple dev servers? |
Good question, why hexo & jekyll support multiple dev servers? |
Hmmm, do you mean that we must support others' support? Where is the actual meaning? |
LOL, don't mind my word. Users may have different requirements. For me, I'm Or I have another question: why we restrict users to open only one dev server? |
While it is not strictly necessary... I agree it can be handy to have that possibility 😃 |
Shouldn't it be a feature request first? If you just submitted a PR and hoped to be merged as soon as possible, then we will discuss whether we need to do it. Will you put the cart before the horse? BTW, I don't want and DON'T have time to argue with you at all. If you want to support a feature, please submit a feature request first. |
I did, sir #355... And you tagged it as |
We just want to know why we need to support this feature. in my opinion, this makes core a little more complex and create a unpleasant directory, and 99% users will only need one instance. so if you can give us a convincing reason, I will support you. But as a reviewer, you just kept asking me. I tagged a I think we should follow such a process: |
And, can you confirm that will the old temp file be deleted when reboot? |
@ulivz They will be deleted immediately after the process exits. However, there may be some exceptions that make the process interrupt unexpectedly, or the machine shutdown accidently, then the temp files will remain there. If we use system tmp directory as my first commit, we don't have to worry about it. If we use local package directory as you suggested, it could be a potential problem that we should delete them manually. |
We can simply implement it with native node.js. since we didn't need And delete the |
After discussion on slack, so far we (@ulivz , @ycmjason and I) have some conclusion:
|
14d9013
to
c7c0cd9
Compare
c992e38
to
c2eaff3
Compare
0c3bc3a
to
cf1e6fc
Compare
Current global vuepress does not support multiple instances.
In other words, we cannot open multiple
dev
server using global installed vuepress.The reason is we are now using a fixed/single temp directory, i.e.
lib/app/.temp
. Each project will overwrite the same temp directory, which will cause collision.For enhancement, I introduce tmp module, which is widely used by many projects.