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

Merge import.meta.require and require to be the same thing #3732

Merged
merged 5 commits into from
Jul 25, 2023

Conversation

paperdave
Copy link
Member

We used to implement require twice. once for import.meta.require and then once in the actual require implementation. This is just old code from before the CJS rewrite.

import.meta.require and createRequire now create an empty JSCommonJSModule and return it's require function.

Fixes #3724, because the old require implementation would not append __esModule to certain case.

@paperdave paperdave force-pushed the dave/require-unification branch 2 times, most recently from 5cede54 to 786345d Compare July 21, 2023 23:54
@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2023

@paperdave 1 files with test failures on linux-x64-baseline:

  • test/bundler/esbuild/ts.test.ts

View test output

#bc138117301c523e52c13c30c1f852b2abdb1335

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2023

@paperdave 1 files with test failures on linux-x64:

  • test/bundler/esbuild/ts.test.ts

View test output

#bc138117301c523e52c13c30c1f852b2abdb1335

@paperdave paperdave force-pushed the dave/require-unification branch 2 times, most recently from 5cede54 to 706d2cb Compare July 22, 2023 00:34
@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2023

@paperdave 7 files with test failures on bun-darwin-aarch64:

  • test/bundler/esbuild/ts.test.ts
  • test/cli/install/bun-remove.test.ts
  • test/cli/install/bunx.test.ts
  • test/js/bun/net/socket.test.ts
  • test/js/bun/spawn/spawn.test.ts
  • test/js/bun/test/test-test.test.ts
  • test/js/web/fetch/fetch-leak.test.js

View test output

#bc138117301c523e52c13c30c1f852b2abdb1335

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2023

@paperdave 11 files with test failures on bun-darwin-x64-baseline:

  • test/bundler/bundler_compile.test.ts
  • test/bundler/bundler_npm.test.ts
  • test/bundler/esbuild/ts.test.ts
  • test/js/bun/http/serve.test.ts
  • test/js/bun/spawn/spawn-streaming-stdin.test.ts
  • test/js/bun/spawn/spawn-streaming-stdout.test.ts
  • test/js/bun/sqlite/sqlite.test.js
  • test/js/bun/util/sleepSync.test.ts
  • test/js/third_party/webpack/webpack.test.ts
  • test/js/web/timers/setInterval.test.js
  • test/js/web/timers/setTimeout.test.js

View test output

#bc138117301c523e52c13c30c1f852b2abdb1335

@Jarred-Sumner
Copy link
Collaborator

Looks like this breaks plugins because plugins for "real" CommonJS aren't actually implemented yet (that's why plugins + svelte tests are failing)

I think that will need to be addressed before this PR can move forward.

@paperdave paperdave force-pushed the dave/require-unification branch from c574f9f to 31145d1 Compare July 24, 2023 23:58
@Jarred-Sumner Jarred-Sumner merged commit 8a0152e into main Jul 25, 2023
@Jarred-Sumner Jarred-Sumner deleted the dave/require-unification branch July 25, 2023 02:32
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.

Vite dev is failing on 0.7
2 participants