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 tests! #2741

Merged
merged 2 commits into from
Apr 27, 2023
Merged

bundler tests! #2741

merged 2 commits into from
Apr 27, 2023

Conversation

paperdave
Copy link
Member

what i think is important

  • 17 splitting tests, mostly due to missing variables / imports.
    • default/TopLevelAwaitAllowedImportWithSplitting also affected
  • import def2, * as ns2 from './c' in test edgecase/ImportNamespaceAndDefault
  • require inside of trycatch is inlined with an error. default/RequireWithCallInsideTry Pasted image 20230425233834
  • default/HashbangBundle we do not add hashbangs like #!/usr/bin/env bun
  • top level await in ES modules breaks default/TopLevelAwaitAllowedImportWithoutSplitting as the __esm is not given an async function
  • define does not work with optional chaining default/DefineOptionalChain
  • require a module that export * from external.edgecase/ExternalES6ConvertedToCommonJSSimplified. complex case default/ExternalES6ConvertedToCommonJS

less important. skipped

  • top level await in a commonjs module does not error. default/TopLevelAwaitForbiddenRequire
  • identifier minification does not ignore comments

@colinhacks
Copy link
Contributor

colinhacks commented Apr 26, 2023

Some other things

  • Bun.build doesn't write to disk yet?
  • Set NODE_ENV=development by default unless otherwise specified
  • Reflect entrypoint hierarchy in outdir. Currently building ['./index.ts', './nested/index.ts'] will flatten the file hierarchy and try to generate two <outdir>/index.js files.
  • Currently [dir] resolves to absolute path instead of relative path when used in naming
  • Some story around asset handling, e.g.:
import logo from "./logo.svg"

export function Logo(){
  return <img src={logo} />
}

This should either a) throw (aka require a plugin to work) or b) convert the import into an absolute path.

Later:

  • Fix --server-components & integrate with bun-plugin-server-components

@github-actions

This comment was marked as spam.

@github-actions

This comment was marked as spam.

@github-actions

This comment was marked as spam.

@Jarred-Sumner
Copy link
Collaborator

This should either a) throw (aka require a plugin to work) or b) convert the import into an absolute path.

B, except it should become a relative path to a copied & hashed asset or, if a --public-url is provided, it should be joined with that URL so that you can host it on a CDN.

@Jarred-Sumner Jarred-Sumner merged commit 5b76ee7 into main Apr 27, 2023
@Jarred-Sumner Jarred-Sumner deleted the dave/bundler-tests branch April 27, 2023 04:57
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.

3 participants