Remote development environments on your infrastructure
Go to file
Bryan ec077c6191
refactor: Migrate from Next.js to pure webpack config (#360)
Fix for #348 - migrate our NextJS project to a pure webpack project w/ a single bundle

- [x] Switch from `next/link` to `react-router-dom`'s link 

> This part was easy - just change the import to `import { Link } from "react-router-dom"` and `<Link href={...} />` to `<Link to={...} />`

- [x] Switch from `next/router` to `react-router-dom`'s paradigms (`useNavigation`, `useLocation`, and `useParams`)

> `router.push` can be converted to `navigate(...)` (provided by the `useNavigate` hook)
> `router.replace` can be converted `navigate(..., {replace: true})` 
>  Query parameters (`const { query } = useRouter`) can be converted to `const query = useParams()`)

- [x] Implement client-side routing with `react-router-dom`

> Parameterized routes in NextJS like `projects/[organization]/[project]` would look like:
> ```
>               <Route path="projects">
>                    <Route path=":organization/:project">
>                    <Route index element={<ProjectPage />} />
>                  </Route>
>               </Route>
> ```

I've hooked up a `build:analyze` command that spins up a server to show the bundle size:
<img width="1303" alt="image" src="https://user-images.githubusercontent.com/88213859/157496889-87c5fdcd-fad1-4f2e-b7b6-437aebf99641.png">

The bundle looks OK, but there are some opportunities for improvement - the heavy-weight dependencies, like React, ReactDOM, Material-UI, and lodash could be brought in via a CDN: https://stackoverflow.com/questions/50645796/how-to-import-reactjs-material-ui-using-a-cdn-through-webpacks-externals
2022-03-12 12:51:05 -08:00
.github refactor: Migrate from Next.js to pure webpack config (#360) 2022-03-12 12:51:05 -08:00
.vscode feat: Automate releases with goreleaser (#404) 2022-03-07 19:50:37 -06:00
agent feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
cli feat: Automate releases with goreleaser (#404) 2022-03-07 19:50:37 -06:00
cmd/coder feat: Automate releases with goreleaser (#404) 2022-03-07 19:50:37 -06:00
coderd refactor: Migrate from Next.js to pure webpack config (#360) 2022-03-12 12:51:05 -08:00
codersdk feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
cryptorand chore: improve coverage of cryptorand package (#377) 2022-02-28 09:50:55 -08:00
database feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
examples refactor: Add example of project with resource (#346) 2022-02-22 18:55:45 -08:00
httpapi feat: Add project API endpoints (#51) 2022-01-24 17:07:42 +00:00
httpmw feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
images/coder fix: Use proper entrypoint for Docker image build (#411) 2022-03-08 16:01:38 +00:00
peer feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
peerbroker feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
provisioner feat: Use open-source Terraform Provider (#403) 2022-03-07 17:39:00 -06:00
provisionerd feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
provisionersdk feat: Use open-source Terraform Provider (#403) 2022-03-07 17:39:00 -06:00
pty fix: TTY being GC'd before command is ran (#412) 2022-03-08 17:48:58 +00:00
scripts feat: Initial E2E test framework for v2 (#288) 2022-03-02 09:26:53 -08:00
site refactor: Migrate from Next.js to pure webpack config (#360) 2022-03-12 12:51:05 -08:00
.gitattributes feat: Update generated schema for provisionerd (#121) 2022-01-31 23:36:15 -06:00
.gitignore feat: Automate releases with goreleaser (#404) 2022-03-07 19:50:37 -06:00
.golangci.yml chore: Add test helpers to improve coverage (#166) 2022-02-05 18:24:51 -06:00
.goreleaser.yml feat: Automate releases with goreleaser (#404) 2022-03-07 19:50:37 -06:00
Makefile refactor: Migrate from Next.js to pure webpack config (#360) 2022-03-12 12:51:05 -08:00
README.md refactor: Add minimal terraform project (#308) 2022-02-17 21:11:48 -08:00
codecov.yml feat: Refactor API routes to use UUIDs instead of friendly names (#401) 2022-03-07 11:40:54 -06:00
develop.sh feat: Automate releases with goreleaser (#404) 2022-03-07 19:50:37 -06:00
go.mod chore: bump github.com/spf13/cobra from 1.3.0 to 1.4.0 (#418) 2022-03-11 08:27:19 -06:00
go.sum chore: bump github.com/spf13/cobra from 1.3.0 to 1.4.0 (#418) 2022-03-11 08:27:19 -06:00
rules.go ci: Replace DataDog CI with custom upload script (#169) 2022-02-07 17:32:32 +00:00

README.md

coder codecov

Coder v2

This repository contains source code for Coder V2. Additional documentation:

Directory Structure

Development

Pre-requisites

  • git
  • go version 1.17, with the GOPATH environment variable set
  • node
  • yarn

Cloning

  • git clone https://github.com/coder/coder
  • cd coder

Building

  • make build
  • make install

The coder CLI binary will now be available at $GOPATH/bin/coder

Development

  • ./develop.sh

The develop.sh script runs the server locally on port 3000, and runs a hot-reload server for front-end code on 8080.

Front-End Plan

For the front-end team, we're planning on 2 phases to the 'v2' work:

Phase 1

Phase 1 is the 'new-wine-in-an-old-bottle' approach - we want to preserve the look and feel (UX) of v1, while testing and validating the market fit of our new v2 provisioner model. This means that we'll preserve Material UI and re-use components from v1 (porting them over to the v2 codebase).

Phase 2

Phase 2 is the 'new-wine-in-a-new-bottle' - which we can do once we've successfully packaged the new wine in the old bottle.

In other words, once we've validated that the new strategy fits and is desirable for our customers, we'd like to build a new, v2-native UI (leveraging designers on the team to build a first-class experience around the new provisioner model).