-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add necessary scripts that on release will publish transpiled template to npm #558
Comments
Pretty sure this is NOT the case 🤔 But I have not tested it. Think we have to adapt the react-sdk kit or generator to check for this directory before trying to transpile it. |
Bounty Issue's service commentText labels: @asyncapi/bounty_team |
@jonaslagoni I only did manual tests and manual eye observation. Only first run is always long, the next ones are super fast - this is why I assume, it looks into transpiled directory first during transpilation |
@derberg on it |
@utnim2 just assigned to you. Good luck and lemme know if you need some more details |
Bounty Issue's Timeline
Please note that the dates given represent deadlines, not specific dates, so if the goal is reached sooner, it's better.Keep in mind the responsibility for violations of the Timeline. |
PR is merged and will be released but it is not yet completed, we need to now test if things improved as expected |
🎉 This issue has been resolved in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
had to revert it as there was a wrong configuration in package.json |
@utnim2 do you plan to open another PR? |
@derberg i was out of town for a bit, will open a PR tommorow |
if @utnim2 is busy, |
ok. Thanks for the reply. |
@webbdays |
Thanks. |
actually I did some tests and it added some good value -> asyncapi/generator#521 (comment) |
Bounty Issue Completed 🎉@utnim2, please go to the AsyncAPI page on Open Collective and submit an invoice for |
Since we migrated this template to React render engine, the generation time, like in other react templates, got super long
Reason - every time generation is run, TS transpilation runs
This can be solved by publishing templates, like this one, to npm with transpilation files included, so basically no transpilation is needed in runtime - unless explicitly requested.
When you clone this repo, install and run
asyncapi generate fromTemplate ./test/spec/asyncapi_v3.yml ./ --output mydocs --force-write
from root, you will notice a new folder called__transpiled
- this is the folder we need to make sure is included in package publishing.This is how generator triggers transpilation -> https://github.com/asyncapi/generator/blob/master/lib/renderer/react.js#L19
Now we need to make sure we have proper script here in template that does the same. This new script needs to be called only by this script -> https://github.com/asyncapi/html-template/blob/master/package.json#L33C6-L33C20
We already have some custom scripts in this repo that run on release -> https://github.com/asyncapi/html-template/blob/master/scripts/copy-sources.js so you just plugin into existing infra.
Note
Completion of this task do not mean yet that time of generation will go down. I think that babel that we use in https://github.com/asyncapi/generator-react-sdk/blob/master/src/transpiler/transpiler.ts is already smart and do not regenerate if
__transpiled
dir is already there but yeah, lets seeThe text was updated successfully, but these errors were encountered: