Skip to content
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

chore: add DevContainer config for GitHub codespaces #4003

Merged
merged 2 commits into from
Jan 11, 2021
Merged

chore: add DevContainer config for GitHub codespaces #4003

merged 2 commits into from
Jan 11, 2021

Conversation

kumaraditya303
Copy link
Contributor

Motivation

Dev container for GitHub codespaces

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Not Required

Related PRs

None

Signed-off-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 6, 2021
@netlify
Copy link

netlify bot commented Jan 6, 2021

✔️ Deploy preview for docusaurus-2 ready!

🔨 Explore the source changes: 9d2b5af

🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-2/deploys/5ffc55ede3dc430007df38d5

😎 Browse the preview: https://deploy-preview-4003--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Jan 6, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 88
🟢 Accessibility 99
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4003--docusaurus-2.netlify.app/classic/

@github-actions
Copy link

github-actions bot commented Jan 6, 2021

Size Change: -2 B (0%)

Total Size: 26.7 kB

ℹ️ View Unchanged
Filename Size Change
website/build/blog/2017/12/14/introducing-docusaurus/index.html 20.7 kB -2 B (0%)
website/build/docs/introduction/index.html 180 B 0 B
website/build/index.html 5.82 kB 0 B

compressed-size-action

@slorber
Copy link
Collaborator

slorber commented Jan 6, 2021

Thanks

Can you give context about this feature?

Why is it useful, and how can I validate that your PR is good?
Please don't assume that I know anything about Github codespaces

@kumaraditya303
Copy link
Contributor Author

kumaraditya303 commented Jan 6, 2021

Thanks

Can you give context about this feature?

Why is it useful, and how can I validate that your PR is good?
Please don't assume that I know anything about Github codespaces

@slorber Github codespaces uses docker containers as a complete dev environment and it can be configured as per the project needs. This pr add the configuration required for docusaurus i.e. install all the packages and forwards the docusaurus port for the user to connect using browsers otherwise users cannot open it.
For validation of pr you can open my forked branch using GitHub codespaces and see if everything is installed correctly. Codespaces info

@slorber
Copy link
Collaborator

slorber commented Jan 6, 2021

@kumaraditya303 thanks but I need more infos.

How can I test your PR exactly and see in practice that it works, and the benefits of supporting Codespaces?

Also, how do we document this so that users can discover this feature?

@kumaraditya303
Copy link
Contributor Author

@kumaraditya303 thanks but I need more infos.

How can I test your PR exactly and see in practice that it works, and the benefits of supporting Codespaces?

Also, how do we document this so that users can discover this feature?

@slorber It similar to gitpod and there isn't any docs needed as GitHub codespaces automatically uses devcontainer.json. Users can directly open with codespaces and good to go.

@kumaraditya303
Copy link
Contributor Author

@slorber do you have access to GitHub codespaces?

@slorber
Copy link
Collaborator

slorber commented Jan 6, 2021

Unfortunately no, I'm still on the waiting list 😅

@kumaraditya303
Copy link
Contributor Author

kumaraditya303 commented Jan 6, 2021

@slorber Ohh, I am a beta and pro user so I got it very early.

@@ -0,0 +1,14 @@
{
"name": "Docusaurus Dev Container",
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:0-10-buster",
Copy link
Collaborator

Choose a reason for hiding this comment

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

how did you choose the image here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We may need something on node LTS 14 instead of node 10

Copy link
Contributor Author

@kumaraditya303 kumaraditya303 Jan 6, 2021

Choose a reason for hiding this comment

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

@slorber Because the GitHub workflow are using nodejs 10 so I chose that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The image I chose is one of the official GitHub codespaces images for nodejs with typescript support

Copy link
Collaborator

Choose a reason for hiding this comment

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

We may move/require node 14 LTS soon so it's better to use node 14 directly for this feature

@slorber
Copy link
Collaborator

slorber commented Jan 6, 2021

Can you show me screenshots or somthing about how this feature works?

I'm ok to merge it as it seems harmful and could check later how it works, just curious to see it in action

@@ -0,0 +1,14 @@
{
"name": "Docusaurus Dev Container",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why tabs?

Copy link
Collaborator

Choose a reason for hiding this comment

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

just reformatted it

@RDIL
Copy link
Contributor

RDIL commented Jan 9, 2021

@kumaraditya303 thanks but I need more infos.
How can I test your PR exactly and see in practice that it works, and the benefits of supporting Codespaces?
Also, how do we document this so that users can discover this feature?

@slorber It similar to gitpod and there isn't any docs needed as GitHub codespaces automatically uses devcontainer.json. Users can directly open with codespaces and good to go.

IMO its a ripoff of Gitpod that is less extendable and I don't see any benefit of using it over Gitpod. Gitpod, unlike Codespaces, is fully open-source.

@kumaraditya303
Copy link
Contributor Author

@slorber
Untitled

@kumaraditya303
Copy link
Contributor Author

Can you show me screenshots or somthing about how this feature works?

I'm ok to merge it as it seems harmful and could check later how it works, just curious to see it in action

@slorber What do you mean by harmful ?

@slorber
Copy link
Collaborator

slorber commented Jan 11, 2021

I meant "does not seem harmful".

Let's merge it and see if people report config problems.
Maybe Gitpod is better, maybe not, it's probably not a bad idea to support both anyway

@slorber slorber changed the title devops: Docusaurus Dev Container chore: add Dev Container config for GitHub codespaces Jan 11, 2021
@slorber slorber changed the title chore: add Dev Container config for GitHub codespaces chore: add GitHub codespace config Jan 11, 2021
@slorber
Copy link
Collaborator

slorber commented Jan 11, 2021

@kumaraditya303 can you reformat the json file with prettier please?

Or give me edit permission on your PR so that I can do it myself? (otherwise I'd need to open another PR)

@kumaraditya303
Copy link
Contributor Author

@slorber given edit permission

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Jan 11, 2021
@slorber
Copy link
Collaborator

slorber commented Jan 11, 2021

thanks

@slorber slorber changed the title chore: add GitHub codespace config chore: add DevContainer config for GitHub codespaces Jan 11, 2021
@slorber slorber merged commit c19c9e5 into facebook:master Jan 11, 2021
@kumaraditya303 kumaraditya303 deleted the devcontainer branch January 11, 2021 14:05
@lex111 lex111 added this to the v2.0.0-alpha.71 milestone Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants