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

Fixes #2671: Add vite to dashboard #2763

Merged

Conversation

Andrewnt219
Copy link
Contributor

@Andrewnt219 Andrewnt219 commented Jan 28, 2022

Issue This PR Addresses

Closes #2671

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Bundle client-side javascript with Vite. This also allows mixing .cjs and .js.

Changelog

  • Setup vite.config.js
  • Update build script and dev script
  • Remove global "toast.js" import
  • Update path to the entry js file of each page
  • Use logger for server errors
  • Stop page render on server's failures

Test plan

  • Run pnpm dev
  • Everything should work as before

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@gitpod-io
Copy link

gitpod-io bot commented Jan 28, 2022

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

Fantastic work! I'm so excited to see this coming along.

src/api/status/package.json Outdated Show resolved Hide resolved
src/api/status/package.json Outdated Show resolved Hide resolved
src/api/status/src/views/builds.hbs Show resolved Hide resolved
src/api/status/src/views/status.hbs Show resolved Hide resolved
src/api/status/vite.config.js Outdated Show resolved Hide resolved
src/api/status/vite.config.js Outdated Show resolved Hide resolved
@humphd humphd requested a review from menghif January 28, 2022 15:01
@humphd humphd added area: dashboard Related to Telescope's dashboard (the page that has stats) area: tools dependencies Pull requests that update a dependency file labels Jan 28, 2022
@Andrewnt219 Andrewnt219 force-pushed the 2671-add-bundler-to-dashboard branch from a1be71c to bd40bef Compare January 28, 2022 16:51
@Andrewnt219 Andrewnt219 force-pushed the 2671-add-bundler-to-dashboard branch from bd40bef to 6f7d6ad Compare January 28, 2022 17:05
@Andrewnt219 Andrewnt219 requested a review from humphd January 28, 2022 17:21
Kevan-Y
Kevan-Y previously approved these changes Jan 28, 2022
Copy link
Contributor

@Kevan-Y Kevan-Y left a comment

Choose a reason for hiding this comment

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

Very nice feature.

src/api/status/src/server.js Outdated Show resolved Hide resolved
@Andrewnt219 Andrewnt219 requested a review from Kevan-Y January 28, 2022 22:49
Copy link
Contributor

@Kevan-Y Kevan-Y left a comment

Choose a reason for hiding this comment

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

LGTM

@Andrewnt219 Andrewnt219 merged commit 869e8b7 into Seneca-CDOT:master Jan 28, 2022
@humphd
Copy link
Contributor

humphd commented Jan 29, 2022

Fantastic

@Andrewnt219
Copy link
Contributor Author

I was expecting the staging to break, too bad.

@Andrewnt219
Copy link
Contributor Author

Just realize if something goes wrong, the logger will bring down the whole server

logger({ error }, 'Fail to fetch data');

@humphd
Copy link
Contributor

humphd commented Jan 29, 2022

Why will that bring down the whole server?

@Andrewnt219
Copy link
Contributor Author

Shouldn't it be logger.warn() instead? Sending a patch now.

@humphd
Copy link
Contributor

humphd commented Jan 29, 2022

Ah, yes. Can you fix in a follow-up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dashboard Related to Telescope's dashboard (the page that has stats) area: tools dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a bundler to dashboard
3 participants