-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
React templates make generation process longer #521
Comments
I see two options to have transpiled template in npm:
|
I think it is ok that
I think this is fine, we just need to make it clear in docs and present it in the template for templates |
Let's wait for other answers, what they think about it. After that, I would like to implement the solution. |
@derberg Maybe we should transfer this issue to |
@magicmatatjahu good point, done |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
@magicmatatjahu I don't remember what |
@derberg To compile the React template and use that "compiled" templated from each run. At the moment we transpile/compile React component by babel on each generation and it is a waste of time. |
@magicmatatjahu thanks, now I remember. I just think now that it should work like this by default. When you run generation, generator first look for sources of compiled template, if provided, and if not, performs old way. And yeah still in template for templates we need to show how to get it into npm |
Exactly in this way, look for transpiled files, if don't exist then run transpilation/compilation and generate template. |
I am getting a bit tired of the long transpile process 😅 @magicmatatjahu would you be able to formulate this into a good first issue? 🙂 |
@magicmatatjahu I second what @jonaslagoni wrote because of this thread https://asyncapi.slack.com/archives/CQVJXFNQL/p1648304288930959 we are getting more and more React-based templates, means more unhappy users. btw, I was wondering if we could not make it |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
Reopening. Now with budget in bounty program maybe we can find someone who could work on improving things |
What needs to be done:
First bullet point might be considered a breaking change, which is not a problem as we can release it as breaking together with #925 and also to use this feature, template developers will anyway have to make changes in their projects to enable release of transpiled files - so they can also change template settings so new version of their template supports latest generator
1-3 can be pushed through bounty program @jonaslagoni @magicmatatjahu sounds like a plan? also we could use this as onboarding of potential new maintainer in generator |
@derberg makes sense to me 👌 |
A non-asked opinion here (not owner): I like the suggested solution 👍 |
actually I think number 1 is not needed I opened a bounty issue for number 3 asyncapi/html-template#558. I noticed that only first generation takes time, and then once transpilation files are there, it is fast, so looks like babel that we use underneath is pretty smart. So lets first modify release for |
Hey @derberg as asyncapi/html-template#558 is near to completion can i open number 3 issue in the CLI |
Ok, so asyncapi/html-template#558 is completed and
which means transpilation runs locally anyway of course it runs faster as some files are there, as they are now included in a package - but we should anyway try to avoid triggering transpilation if not needed
so we gained at speed significantly anyway! thanks @utnim2 |
@utnim2 CLI is point |
is point 1 needed you have said here that point 1 is not needed |
yeah, so we see optimization worked but mainly because of babel that is smart and just tries to regenerate what is not available. But logs still show babel is triggered, so yeah, we should skip it entirely if not needed. So generator should perform transpilation only if explicitly "asked" or if transpiled folder is not present |
@derberg will you make the issue or should I proceed with a PR directly |
@utnim2 no need for separate issue, just refer to this one |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
still in progress - almost there |
Describe the bug
Markdown template is the simples one we have, yet it takes 5s to generate
asyncapi.md
with it. Which is really a lot and I bet it will be worse with more complicated templates.How to Reproduce
Just try to generate with HTML template and then markdown one and you'll see that there is a time difference each time.
The problem is in transpilation process with babel. @magicmatatjahu checked and:
Expected behaviour
IMHO by default, when you run generation, an already transpiled template is used to speed up (yes, it means we publish transpiled files to npm too). The generator is smart and spots transpiled files are missing and it needs to run transpilation. Users (template developers) also have a flag that allows them to explicitly run transpilation during development
The text was updated successfully, but these errors were encountered: