wallabyjs / quokka

Repository for Quokka.js questions and issues
https://quokkajs.com
1.18k stars 31 forks source link

Feature Request: allow Quokka to run on a selected piece of JavaScript code (not the entire file) #904

Closed koraysels closed 2 months ago

koraysels commented 1 year ago

Issue description or question

Is this issue related to Quokka not outputting the expected results of your code?: No

Code editor version

Webstorm

OS name and version

OSX

question?

How to only execute a highlghted/selected piece of javascript code. Without running the entire js file?

smcenlly commented 1 year ago

Quokka currently only allows you to run your entire file, but we're working on an exciting new feature that will change this.

I'll repurpose your question as a feature request.

koraysels commented 1 year ago

Quokka currently only allows you to run your entire file, but we're working on an exciting new feature that will change this.

I'll repurpose your question as a feature request.

Nice! I teach computer science and this would be very handy while teaching.

stychu commented 2 months ago

Is this feature implemented already ? I would love to use snaps but my project is setup with esm and quokka seems not recognize import of packages at least It cant find the importing package from my file which is private package.

smcenlly commented 2 months ago

@stychu - yes - this is supported using Quokka Snaps. It should be working with ES modules (it is for us):

image

If it's not working for you, can you please create a new issue and provide a code sample so we can attempt to reproduce your problem?

smcenlly commented 2 months ago

Closing this feature request, supported using Quokka Snaps which was released November 2023.