-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix #1613 #1788
Fix #1613 #1788
Conversation
@Swader have added the init hook. Would you be able to test it and let me know if this works for you? |
Yup, thanks, testing it today! |
Hello thx for the pr. @Swader Can you provide a real example of your need please it could be great and easier to understand your need maybe it can be relevant for other people. |
@f3ltron it's described here: #1613 I'm currently trying to figure out how to test this on an existing project.. |
TL;DR: I'm building a doc generator so I need a script to prepare the MD content dynamically BEFORE the rendering process, so that the rendering happens on generated materials, rather than before they're prepared. I could write a separate npm script for that, but I wanted this to be part of Vuepress to integrate somewhat properly. |
hum look at my plugin https://github.com/f3ltron/vuepress-plugin-docgen. I did the same thing. But i face an issue on it about the dev process. I need vuepress re render every markdown i create after changes. Is that your need at the end ? |
@f3ltron yes I think so. |
Ok swader i am working on the vuepress eco system maybe i could help you on it as soon as possible. I am not sure that the hook will answer 100% of your need so if you need a reload at any change you make. |
All I need is for the |
Are you familar with the yarn link etc ? |
I am not, no. I have the fork cloned into a local folder due to #1790 but I have no idea how to temporarily make that clone active instead of the global vuepress I currently have installed. |
What you can do for now to test is. git clone his repo on his branch
make sure you clean you vuepress dependencies on you project delete it on package.json if you have. Delete package lock / node_modules.
now you can link you local vuepress to your project go to your project.
You should not have vuepress in you package but present in your node_modules from here you should be able to add this in your config vuepress files
I didn't try it myself but you could use it here. I am not sure it will solve your problem but tell me |
I currently have vuepress installed globally, will this not interfere with the local install? |
if you work with link packages its better to delete if globally. It's better to never use global packages |
@f3ltron that seems like a strange thing to say given that official instructions recommend adding it globally by default. But I'll try the remove thing, sure, thanks! |
It should be a mistake. Let me know if you have problems |
@f3ltron thank you, process works perfectly. I seem to have run into some other bug that causes an infinite loop of some kind, though, so debugging that now, but almost 100% sure it's because of my project, not this fix. Looking into it, hopefully will have this resolved tonight and @shad-k can get paid :) |
Super swader dont hesitate to re open issue and mention me. If it's all cool for you let's close this one. |
Let's not close it, I would like to see this PR merged. Is that not an option? What's the blocker, if it works as intended? |
When you have done your test let us have a repo to reproduce your need that we can check if it's interesting to implement it for others |
I think there's a language barrier of some kind. My repo is at https://github.com/status-im/nimbus-docs-suite My goal is to run preparation steps before But in general, this solution does exactly what I wanted it to do: it triggers some functionality before the |
Ok maybe we should resolve your issue with the infinity loop before so |
The problem with the loop is that the webpackbar is being rendered via a renderloop in CMDER on Windows, but my plugin is using |
@@ -1,5 +1,22 @@ | |||
# Lifecycle | |||
|
|||
## int |
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.
init
@shad-k I'm trying to figure out why Notice the "writing to file" - those are mine, happening in the plugin which is hooked into Debugging further... |
@Swader can I see the code where you use the init hook? |
@Swader I am not very sure of what might be going wrong, but I guess you might need to return a Promise from |
@shad-k I couldn't figure it out. In the end I just extracted the plugin functionality outside and ran the build with a new script that does @f3ltron this can be closed. |
Thank's @shad-k if you think it should be reopen explain why on this thread thx ! |
Summary
Adds a
init
hook to the plugin lifecycle.What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
#1613