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

Introduce bun ./index.html #16993

Merged
merged 13 commits into from
Feb 3, 2025
Merged

Introduce bun ./index.html #16993

merged 13 commits into from
Feb 3, 2025

Conversation

Jarred-Sumner
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner commented Feb 2, 2025

What does this PR do?

This lets you start a frontend dev server by directly running .html files in Bun.

> bun index.html
Bun v1.2.3 ready in 0.03 ms

➜ http://localhost:3001/

Press h + Enter to show shortcuts

For multi-page apps, you can pass multiple routes explicitly.
image

You can also pass a glob.
image

If you pass only one route, that route is matched as the fallback route so that you can use this with single-page apps that do client-side routing from a single shared entry point.

How did you verify your code works?

There are tests

@robobun
Copy link

robobun commented Feb 2, 2025

Updated 4:05 AM PT - Feb 3rd, 2025

@Jarred-Sumner, your commit 0941c6b has 3 failures in Build #11044:


🧪   try this PR locally:

bunx bun-pr 16993

@jakeg
Copy link
Contributor

jakeg commented Feb 2, 2025

@Jarred-Sumner why's it stripping out <script> tags?

image

Here you can see the <script> tag is gone:

image

@Jarred-Sumner
Copy link
Collaborator Author

Looks like a bug. It’s expecting a <head> tag to inject the <script> into

@jakeg
Copy link
Contributor

jakeg commented Feb 2, 2025

Yeah, I never bother with <html>, <head> or <body> tags for quick things, as my understanding is that they're optional, and the minimum required for a valid HTML document is a <!doctype html> and a <title>.

@RiskyMH
Copy link
Member

RiskyMH commented Feb 3, 2025

btw this bug mentioned above is tracked in #16973


### Tailwind CSS

To use TailwindCSS, add the plugin to your `bunfig.toml`:
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to mention you need to install this package (as it was one a decent confusion with people thinking it was inbuilt)

Also why is there so much duplication between pages, are you merging fullstack.md into this? Or at very least make some template so they are the same and can't as easily get so different

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

duplication in docs is generally fine IMO. People don't read every page.

@Jarred-Sumner
Copy link
Collaborator Author

Going to merge this, but @paperclover please take a look over it when you get a chance.

@Jarred-Sumner Jarred-Sumner merged commit 1ea14f4 into main Feb 3, 2025
65 of 69 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/html-entry-points branch February 3, 2025 12:06
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.

4 participants