aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/modules (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-02[node:buffer] Implement `isUtf8` and `isAscii` (#3498)Gravatar Jarred Sumner 1-0/+130
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-27Update NodeModuleModule.cppGravatar Jarred Sumner 1-2/+5
2023-06-26Fix default export of `"module"` modulebun-v0.6.10Gravatar Jarred Sumner 1-46/+56
2023-06-26webpack test and add empty `prototype` prop to module (#3421)Gravatar Dylan Conway 1-3/+6
2023-06-26implement `_nodeModulePaths` and `require.main.paths` (#3411)Gravatar Dylan Conway 1-11/+4
* tests in progress * add `require.main.paths`, add every dir up to root * remove imports
2023-06-25Fix test failures in import.meta (#3403)Gravatar Jarred Sumner 1-17/+6
* Fix test failures in import.meta * regenerate * Use bound functions for `import.meta.require` and `import.meta.require.resolve` and `Module.createRequire` --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-24Rewrite Bun's runtime CommonJS loader (#3379)Gravatar Jarred Sumner 4-30/+36
* wip changes for CommonJS * this rewrite is almost complete * even more code * wip * Remove usages of `import.meta.require` from builtins * Remove usages of require * Regenerate * :scissors: builtin rewrite commonjs in printer * Use lazy custom getters for import.meta * fixups * Remove depd * ugh * still crashing * fixup undici * comment out import.meta.require.resolve temporarily not a real solution but it stops the crashes * Redo import.meta.primordials * Builtins now have a `builtin://` protocol in source origin * Seems to work? * Finsih getting rid of primordials * switcharoo * No more function * just one more bug * Update launch.json * Implement `require.main` * :scissors: * Bump WebKit * Fixup import cycles * Fixup improt cycles * export more things * Implement `createCommonJSModule` builtin * More exports * regenerate * i broke some stuff * some of these tests work now * We lost the encoding * Sort of fix zlib * Sort of fix util * Update events.js * bump * bump * bump * Fix missing export in fs * fix some bugs with builtin esm modules (stream, worker_threads, events). its not perfect yet. * fix some other internal module bugs * oops * fix some extra require default stuff * uncomment this file but it crsahes on my machine * tidy code here * fixup tls exports * make simdutf happier * Add hasPrefix binding * Add test for `require.main` * Fix CommonJS evaluation order race condition * Make node:http load faster * Add missing exports to tls.js * Use the getter * Regenerate builtins * Fix assertion failure in Bun.write() * revamp dotEnv parser (#3347) - fixes `strings.indexOfAny()` - fixes OOB array access fixes #411 fixes #2823 fixes #3042 * fix tests for `expect()` (#3384) - extend test job time-out for `darwin-aarch64` * `expect().resolves` and `expect().rejects` (#3318) * Move expect and snapshots to their own files * expect().resolves and expect().rejects * Fix promise being added to unhandled rejection list * Handle timeouts in expect(<promise>) * wip merge * Fix merge issue --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * fixup min/memcopy (#3388) * Fix crash in builtins * Don't attempt to evaluate modules with no source code * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Fix crash * cleanup * Fix test cc @paperdave * Fixup Undici * Fix issue in node:http * Create util-deprecate.mjs * Fix several bugs * Use the identifier * Support error.code in `util.deprecate` * make the CJs loader slightly more resilient * Update WebCoreJSBuiltins.cpp * Fix macros --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com> Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-04-13Upgrade WebKit (#2643)Gravatar Jarred Sumner 1-1/+1
* Missing export * Regenerate builtins * Fix crash in require() * Various breaking JSC changes * hopefully speed up C++ compilation a little * Skip failing test fo rnow * Update WebKit * Add a comment * Fix error in postinstall * Update WebKit --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-02-12Set `require("module").globalPaths` to empty arrayGravatar Jarred Sumner 1-0/+3
https://github.com/oven-sh/bun/issues/1641#issuecomment-1427017442
2023-01-16Add missing `buffer` module exportsGravatar Jarred Sumner 1-13/+79
2023-01-11`require.resolve` in the runtime should use CommonJS export conditionsGravatar Jarred Sumner 1-28/+16
2023-01-0410x faster `new Buffer` (#1717)Gravatar Jarred Sumner 1-4/+2
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-12-02[node:event] Add `captureRejectionSymbol`Gravatar Jarred Sumner 1-0/+4
2022-11-16Mark some more commonjs modulesGravatar Jarred Sumner 2-7/+34
2022-09-28Support a `default` object in CommonJS wrapperGravatar Jarred Sumner 1-0/+18
Fixes https://github.com/oven-sh/bun/issues/1284 Related to https://github.com/oven-sh/bun/issues/1285
2022-09-25Implement `isatty` in `node:tty`Gravatar Jarred Sumner 1-0/+69
2022-09-06Fix issue with `process` esm node exportGravatar Jarred Sumner 1-31/+68
2022-09-06Add missing `Blob`Gravatar Jarred Sumner 1-2/+2
2022-09-05Support async `onLoad` callbacks in `Bun.plugin`Gravatar Jarred Sumner 2-47/+69
2022-09-05Move `generateObjectModuleSourceCode` to separate file to fix build errorGravatar Jarred Sumner 2-24/+31
2022-09-05`inline`Gravatar Jarred Sumner 1-1/+1
2022-09-05Missing #pragma onceGravatar Jarred Sumner 1-0/+2
2022-09-04`[node:module]` Implement `_resolveFileName`, stub `_nodeModulePaths` & `_cache`Gravatar Jarred Sumner 1-3/+63
Closes https://github.com/oven-sh/bun/issues/1111
2022-09-03Fix `createRequire()` in `node:module`Gravatar Jarred Sumner 2-0/+150
Fixes https://github.com/oven-sh/bun/issues/831 Fixes https://github.com/oven-sh/bun/issues/453
2022-09-03Fix build errorGravatar Jarred Sumner 1-6/+5
2022-09-03Plugin API (#1199)Gravatar Jarred Sumner 1-0/+32
* Plugin API * Fix the bugs * Implement `"object"` loader Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-09-01Add native StringDecoder (#1188)Gravatar Zilin Zhu 1-0/+15
* Add native StringDecoder * fix upon reviews * add Constructor and use LazyClassStructure
2022-08-23add SlowBuffer (#1133)Gravatar Zilin Zhu 1-0/+6
2022-08-21Add native EventEmitter (#1123)Gravatar Zilin Zhu 1-0/+27
* Add native EventEmitter * add listeners, listenerCount and eventNames * add global functions * add Object to EventEmitter conversion * fix upon review
2022-08-17Add native process module (#1095)Gravatar Zilin Zhu 1-0/+39
2022-08-14Add synthetic buffer module (#1076)Gravatar Zilin Zhu 1-0/+27
* Add synthetic buffer module * rename Buffer.h to BufferModule.h