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

feat: simplify vite server #15416

Merged
merged 59 commits into from
Mar 31, 2021
Merged

feat: simplify vite server #15416

merged 59 commits into from
Mar 31, 2021

Conversation

elevatebart
Copy link
Contributor

@elevatebart elevatebart commented Mar 11, 2021

User facing changelog

  • On vite dev server,
    • make errors display with the proper viewport and with the full power of vite
    • Add support for testing library (global was missing)
    • Fixed support for vite plugins
    • Fixed support for loading css and images

Additional details

  • routes-ct: Pass down the original routes with their __cypress/src prefix to the dev-server
  • vite-dev-server: remove some of the complexity of the import
  • Use cypress hooks instead of mocha hooks to init each test

How has the user experience changed?

failure-vite-demo.mov

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 11, 2021

Thanks for taking the time to open a PR!

Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

I have many questions about this PR, but nice job implementing the hooks!

@@ -58,12 +29,6 @@
Cypress.onSpecWindow(window, importsToLoad)
Cypress.action('app:window:before:load', window)

before(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am sure we need this - please try running a spec with multiple it blocks that mount a React component. One called react-no-jsx.spec.tsx.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible we don't!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tests in this spec are passing, both in CI and in open mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually scratch that, they only work on open, not in CI...

Copy link
Contributor

Choose a reason for hiding this comment

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

Bizarre

Better fix that before merging, can help out if needed

npm/vite-dev-server/index-template.html Show resolved Hide resolved
npm/vite-dev-server/index-template.html Show resolved Hide resolved
@elevatebart elevatebart force-pushed the feat/vite-error-management branch from 43aa4b9 to f98a0af Compare March 12, 2021 21:29
@cypress
Copy link

cypress bot commented Mar 12, 2021



Test summary

9392 0 119 3Flakiness 1


Run details

Project cypress
Status Passed
Commit a75f168
Started Mar 31, 2021 4:04 PM
Ended Mar 31, 2021 4:16 PM
Duration 11:45 💡
OS Linux Debian - 10.5
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/retries.ui.spec.js Flakiness
1 runner/cypress retries.ui.spec > opens attempt on each attempt failure for the screenshot, and closes after test passes

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@JessicaSachs
Copy link
Contributor

I'm unable to test this... it's still erroring.

lmiller1990
lmiller1990 previously approved these changes Mar 19, 2021
@JessicaSachs
Copy link
Contributor

I picked up Chakra's new Vite impl and tested it out. It's failing with a new kind of dependency optimization error.

Here's a link to the branch/fork

@lmiller1990 lmiller1990 self-requested a review March 22, 2021 15:28
@elevatebart elevatebart merged commit adc2fc8 into develop Mar 31, 2021
@elevatebart elevatebart deleted the feat/vite-error-management branch March 31, 2021 16:16
elevatebart pushed a commit that referenced this pull request Apr 2, 2021
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.

3 participants