Skip to content

Conversation

@fgreinacher
Copy link
Contributor

@fgreinacher fgreinacher commented Jan 26, 2022

Description

See the related issue for context.

This PR introduces the following changes:

Related issue(s)

Closes #249

@netlify
Copy link

netlify bot commented Jan 26, 2022

✔️ Deploy Preview for modest-rosalind-098b67 ready!

🔨 Explore the source changes: cb46528

🔍 Inspect the deploy log: https://app.netlify.com/sites/modest-rosalind-098b67/deploys/61f28aa9b317d1000834f93a

😎 Browse the preview: https://deploy-preview-248--modest-rosalind-098b67.netlify.app

src/index.tsx Outdated
Comment on lines 13 to 21
return './js/monaco/json.worker.bundle.js';
}
// for yaml worker
if (label === 'yaml' || label === 'yml') {
return '../../js/monaco/yaml.worker.bundle.js';
return './js/monaco/yaml.worker.bundle.js';
}
// for core editor worker
return '../../js/monaco/editor.worker.bundle.js';
return './js/monaco/editor.worker.bundle.js';
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the former paths just worked by accident because .. does nothing when already at the root path.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, if we load bundled JS file in the index.html then we can use path from root. In the preview I see that it works, but there is a question: why does it also work in current deploy on https://studio.asyncapi.com where we have that old path? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I wonder if we should use it here process.env.PUBLIC_URL to be more safe?

@fgreinacher
Copy link
Contributor Author

@magicmatatjahu We noticed this after deploying the new Docker image from #240 to our Kubernetes cluster. Maybe you can have a look again?

@fgreinacher fgreinacher marked this pull request as ready for review January 26, 2022 11:35
@magicmatatjahu
Copy link
Member

magicmatatjahu commented Jan 26, 2022

@fgreinacher

@magicmatatjahu We noticed this after deploying the new Docker image from #240 to our Kubernetes cluster. Maybe you can have a look again?

Hi! No problem, I hope that I will make review today! I already made 4/5 reviews today and nexts wait for me 😅

Copy link
Member

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fgreinacher Thanks for your contribution! :) We are very thankful but I have a few comments, please refer to them :)

src/index.tsx Outdated
Comment on lines 13 to 21
return './js/monaco/json.worker.bundle.js';
}
// for yaml worker
if (label === 'yaml' || label === 'yml') {
return '../../js/monaco/yaml.worker.bundle.js';
return './js/monaco/yaml.worker.bundle.js';
}
// for core editor worker
return '../../js/monaco/editor.worker.bundle.js';
return './js/monaco/editor.worker.bundle.js';
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, if we load bundled JS file in the index.html then we can use path from root. In the preview I see that it works, but there is a question: why does it also work in current deploy on https://studio.asyncapi.com where we have that old path? 🤔

Comment on lines +8 to 11
COPY package.json package-lock.json ./
RUN npm install --frozen-lockfile

COPY ./ ./
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these commands are split? What we have benefit here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a common optimization to speed up Docker builds. It will cache the result of npm install and not execute it unless package.json or package-lock.json have changed.

FROM docker.io/library/nginx:1.21.5-alpine as runtime

ARG BASE_URL_PLACEHOLDER
ARG ENTRYPOINT_SCRIPT=/docker-entrypoint.d/set-public-url.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add info about docker-entrypoint.d? Tbh I had to read about it, because I didn't know about that 😅 You know, for future contributors to help them understand that step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sure! I added a comment!

src/index.tsx Outdated
Comment on lines 13 to 21
return './js/monaco/json.worker.bundle.js';
}
// for yaml worker
if (label === 'yaml' || label === 'yml') {
return '../../js/monaco/yaml.worker.bundle.js';
return './js/monaco/yaml.worker.bundle.js';
}
// for core editor worker
return '../../js/monaco/editor.worker.bundle.js';
return './js/monaco/editor.worker.bundle.js';
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I wonder if we should use it here process.env.PUBLIC_URL to be more safe?

@fgreinacher
Copy link
Contributor Author

fgreinacher commented Jan 26, 2022

Also I wonder if we should use it here process.env.PUBLIC_URL to be more safe?

@magicmatatjahu I cannot comment inline, no idea why... Yes, that makes sense.

I think I addressed everything, much better now!

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@magicmatatjahu
Copy link
Member

@fgreinacher Ok, I checked and everything works. Thanks very much for contribution! If you will have any problems with new docker image please ping me in this PR :)

@magicmatatjahu
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit 53957ef into asyncapi:master Jan 27, 2022
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@fgreinacher fgreinacher deleted the feat/add-base-url branch January 27, 2022 21:09
@fgreinacher
Copy link
Contributor Author

Works great now, thanks again for the quick review!

image

KhudaDad414 pushed a commit to KhudaDad414/studio that referenced this pull request Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run AsyncAPI Studio at subpath

3 participants