Giter Club home page Giter Club logo

Comments (12)

FredKSchott avatar FredKSchott commented on May 5, 2024 2

If we can get even just a single-file Astro compiler working in the browser, then I'm definitely going to start pushing for a browser REPL for public launch :)

from astro.

georges-gomes avatar georges-gomes commented on May 5, 2024 1

Would be nice if you can either take the file system as an object input or take a callback to retrieve files.

If we pull this off, you can embed components.studio as a REPL and walkthroughs.dev will also work.

from astro.

matthewp avatar matthewp commented on May 5, 2024

I think it's doable. At the moment the biggest issue is that we compile dependencies (both static and client dynamic) into URLs that only the Astro runtime understands. But I think it's probably possible to leave those alone. I'll take a crack at the idea this week, maybe in a branch, and see what you think.

from astro.

georges-gomes avatar georges-gomes commented on May 5, 2024

That would be very cool πŸ‘

from astro.

FredKSchott avatar FredKSchott commented on May 5, 2024

I'd love to support an in-browser compiler, but a lot of how Astro works requires file system access. For example, if you import a React component, we need to load that component and render it to HTML.

In some ways, it would be like trying to deliver an in-browser compiler for Next.js.

from astro.

matthewp avatar matthewp commented on May 5, 2024

I don't think the compiler portion of Astro requires file system access. We don't render React/etc. components to HTML until execution. An Astro file compiles to a JavaScript module. That module contains imports to other modules (including framework components). If the runtime can resolve a bare specifier then it should be able to handle a compiled Astro file (I think I haven't looked deeply enough to confirm this).

from astro.

georges-gomes avatar georges-gomes commented on May 5, 2024

from astro.

jasikpark avatar jasikpark commented on May 5, 2024

https://play.astro.build could be very cool -- akin to https://play.tailwindcss.com

from astro.

tony-sull avatar tony-sull commented on May 5, 2024

https://play.astro.build could be very cool -- akin to https://play.tailwindcss.com

I'm a big fan of Svelte's REPL as well. It's even tied in to GitHub so you can save sessions as gists

from astro.

mash-graz avatar mash-graz commented on May 5, 2024

stackblitz webcontainers and next.js live look like very promising solutions concerning this feature request, although both of them will not satisfy all the requirements of astro right now.

from astro.

natemoo-re avatar natemoo-re commented on May 5, 2024

We've made some huge progress on this front! Will keep this issue open until all of this lands as stable, but...

https://github.com/snowpackjs/astro-compiler-next will be a stand-alone package published as @astrojs/compiler and https://astro.build/play is running it in the browser!

from astro.

FredKSchott avatar FredKSchott commented on May 5, 2024

Awesome work @natemoo-re !!!

I feel like this is safe to close now, with work continuing in the https://github.com/snowpackjs/astro-compiler-next repo. We'll keep making improvements to the API as we get closer to v1.0. Cheers yall! πŸ₯³

from astro.

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.