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

Bundler API: Bun.build and Bun.App #2551

Closed
wants to merge 22 commits into from
Closed

Conversation

colinhacks
Copy link
Contributor

@colinhacks colinhacks commented Apr 4, 2023

docs/rfcs/bun-bundler.ts Outdated Show resolved Hide resolved
docs/rfcs/bun-bundler.ts Outdated Show resolved Hide resolved
docs/rfcs/bun-app.ts Outdated Show resolved Hide resolved
@colinhacks colinhacks changed the title Bundler API Bundler API: Bun.build and Bun.App Apr 20, 2023
@@ -0,0 +1,40 @@
export const enum MessageLevel {
err = 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make these align with console.x, e.g. error, warn, info, debug (do we need "note"?)

export interface Log {
warnings: number;
errors: number;
msgs: Message[];
Copy link
Contributor

Choose a reason for hiding this comment

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

messages pls

on: MessageMeta;
}

export interface Log {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this has an extra layer of nesting that doesn't add a lot of value.

Current:

{
   log: {
      warnings: 0,
      errors: 0,
      messages: []
   }
}

Alternative (simplified)

{
   errors: [],
   warnings: []
}

column: number;
line_text: string;
suggestion: string;
offset: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the index of the location? (e.g. line + col mapped to an array)

namespace: string;
line: number;
column: number;
line_text: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

How about just text? to match with MessageData#text and also to avoid snake-case.

level: MessageLevel;
data: MessageData;
notes: MessageData[];
on: MessageMeta;
Copy link
Contributor

Choose a reason for hiding this comment

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

Confused what this would look like.

@colinhacks colinhacks force-pushed the rfc/bun-bundler-api branch from 915a86f to d3d22dc Compare May 31, 2023 00:55
@phenomen
Copy link

phenomen commented Sep 12, 2023

Is it possible to make public/static assets directory copying into the outdir a part of Bun.build, not Bun.app?

I build a library (not app) with assets (images, css, fonts, json) that I don't import directly in the code but reference them with absolute paths. Those static assets should not be transformed.

It would match Vite's public directory behavior that put public folder into the bundle without transforms on build step.

@ghost
Copy link

ghost commented Jan 10, 2024

Please include this in a release soon - it's a great feature and there are tons of cool uses.

@ghost
Copy link

ghost commented Aug 1, 2024

@Jarred-Sumner where can I read why you changed your mind about adding Bun.App?

@Electroid
Copy link
Contributor

@zoto-ff We didn't change our minds, we were just cleaning up old PRs. We do plan to work on this.

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.

5 participants