x/pkgsite: using npm packages for frontend development #43358
Closed
Comments
This was referenced Dec 24, 2020
Change https://golang.org/cl/280598 mentions this issue: |
Change https://golang.org/cl/280599 mentions this issue: |
gopherbot
pushed a commit
to golang/pkgsite
that referenced
this issue
Dec 29, 2020
Installs dependencies for typescript and stylelint and adds scripts to package.json for linting code. The linter will ignore code in content/static for now. A new directory to be added, content/lib, will contain the typescript and unprocessed css files. For golang/go#43358 Change-Id: I6ee74665a99af8938df6f1ee675c8705fcce589c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/280599 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org> Trust: Jamal Carvalho <jamal@golang.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We're working to improve frontend development ergonomics for pkgsite. This is the first in a series of issues about our plans. Comment below with any feedback or suggestions related to this issue!
The Go team has taken a philosophical stance against ballooning dependencies (https://research.swtch.com/deps). As a result we’ve tried to minimize our use of npm packages with a general rule of not adding them.
The amount of JavaScript needed to implement interactive pkgsite features and meet our accessibility standards is non-trivial. It's important to prevent regressions and maintain a high standard of quality in this code. Today, JavaScript code on pkgsite is tested manually on an ad-hoc basis. Code format and style issues reduce the speed of code review. Fixing these problems without npm is possible but a lot of really useful tooling in the frontend development ecosystem is written with JavaScript and managed with npm.
To enable the use of industry standard frontend development tools, we’re planning to update the pkgsite process for building and testing web assets (scripts, css, images, html) to depend on a minimal set of npm packages. Our plan is to limit this set to development dependencies and no code from node modules will be imported into the JavaScript we serve on pkgsite.
A script will be added to the devtools directory that will install packages and run npm scripts from a node binary installed within a docker container. Installing and using these tools will be optional for contributors that only make changes to non-frontend code and we'll continue to check the distributable frontend assets into the repository.
Related Issues
The text was updated successfully, but these errors were encountered: