Giter VIP home page Giter VIP logo

Comments (7)

sheremet-va avatar sheremet-va commented on May 24, 2024

Can't you use setupFiles for this?

from vitest.

edoardocavazza avatar edoardocavazza commented on May 24, 2024

Nope, they are loaded after BroadcastChannel initialization, so the polyfill won't work.

from vitest.

sheremet-va avatar sheremet-va commented on May 24, 2024

If BroadcastChannel channel is not supported by compatible versions (we use the same compatibility table that Vite Dev server uses) then we should rewrite it to use something else.

from vitest.

sheremet-va avatar sheremet-va commented on May 24, 2024

As a team, we decided that the Vitest browser mode only supports browsers that implement BroadcastChannel, this is now documented.

from vitest.

edoardocavazza avatar edoardocavazza commented on May 24, 2024

It is reasonable that vitest wont support old browsers out of the box. I was just asking if you would consider to support scripts injection in order to let developers to load polyfills themselves 🙂

from vitest.

sheremet-va avatar sheremet-va commented on May 24, 2024

We did another round of discussion and decided it would be a good idea to expose an option to inject a script into HTML. Vitest has two HTML documents, so there will be two options.

from vitest.

edoardocavazza avatar edoardocavazza commented on May 24, 2024

Thank you so much!

from vitest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.