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

Introduce frontend build system using npm, Parcel and TypeScript #1565

Merged
merged 5 commits into from
Apr 18, 2023

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Mar 31, 2023

Since the site binary is now self-contained (and soon will be published on CI via nightly releases), we can now add some basic frontend tooling to make it easier to change the perf.RLO UI in the future.

This PR adds a npm project (which is required to use common modern frontend technologies) and enables the use of TypeScript in UI components using the Parcel bundler. I wanted to use only TypeScript at first, but it cannot bundle .vue single file components, which we will hopefully use to author the UI components, out of the box. And we will also want to bundle at least (S)CSS, so I chose to use a build system. Parcel doesn't require any configuration, is fast, works pretty much out of the box and very easily allows to build the app into multiple components (which is very useful, because the UI site will be a multi-page application, not a single-page application). I tried several other bundlers, but didn't encounter anything else that would have all these properties.

Currently the transpilation step from TypeScript assumes ES2015, and e.g. keeps async functions and await in the output. I was a bit worried about this, but then I realized that browsers have supported these things for a long time now.. so it should be fine. If there would be some problem, we can always switch back to a polyfill.

(Btw the actual diff is like 150 lines of code, most of the added lines is just the npm lockfile 😅).

The`dashboard` page is ported to the new frontend.
site/.gitignore Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@Kobzol Kobzol merged commit 0bacca1 into master Apr 18, 2023
@Kobzol Kobzol deleted the frontend-npm branch April 18, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants