-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(bake): add dependencies to IncrementalGraph #14368
Conversation
❌ @paperdave, your commit 0568133 has 6 failures in test/js/web/streams/streams.test.js - 1 failing on 🍎 14 x64test/js/web/fetch/fetch-tcp-stress.test.ts - timeout on 🍎 14 aarch64test/js/web/fetch/fetch-tcp-stress.test.ts - timeout on 🍎 13 aarch64test/js/web/fetch/fetch-tcp-stress.test.ts - timeout on 🍎 14 x64test/js/web/fetch/fetch-tcp-stress.test.ts - timeout on 🍎 13 x64test/bundler/bundler_compile.test.ts - 7 failing on 🪟 x64test/bundler/bundler_compile.test.ts - 5 failing on 🪟 x64-baselinetest/cli/watch/watch.test.ts - 2 failing on 🪟 x64test/cli/watch/watch.test.ts - 2 failing on 🪟 x64-baselinetest/cli/hot/watch.test.ts - 1 failing on 🪟 x64test/cli/hot/watch.test.ts - 1 failing on 🪟 x64-baselinetest/js/bun/http/bun-serve-static.test.ts - 1 failing on 🍎 13 aarch64 |
/// Reverse of the slice index operator. | ||
/// Given `&slice[index] == item`, returns the `index` needed. | ||
/// The item must be in the slice. | ||
pub fn indexOfPointerInSlice(comptime T: type, slice: []const T, item: *const T) usize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not account for alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesnt sizeOf return the size of the item in the slice?
if so, this function asserts the item is in the slice; regardless of how the slice is aligned, the item must be at some multiple of the size after the pointers are subtracted.
@@ -8677,6 +8677,14 @@ pub const ServerComponentBoundary = struct { | |||
bun.unsafeAssert(l.list.capacity > 0); // optimize MultiArrayList.Slice.items | |||
return l.list.items(.reference_source_index)[i]; | |||
} | |||
|
|||
pub fn bitSet(scbs: Slice, alloc: std.mem.Allocator, input_file_count: usize) !bun.bit_set.DynamicBitSetUnmanaged { | |||
var scb_bitset = try bun.bit_set.DynamicBitSetUnmanaged.initEmpty(alloc, input_file_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use AutoBitSet here if possible. That will hold the memory inline if it fits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think autobitset is useful when you can just use stack-fallback allocator, which will hold the memory on the stack and avoid extra branches when reading into the bitset
Progress for #14324
Bake now properly tracks dependencies between files. When updating a file, the graph is traversed upwards for dependencies to the route files.
Updating a file now properly indicates which routes were updated (having a tab open on an unaffected route will not yield an update).
Updating a client component will, despite re-bundling SSR code, not invoke a server-side rerender. This is because the client code is sent over and used.
This does not handle an edge case with server files that reside in both the Server and SSR graphs. The first file's imports are not tracked because the second one overrides them. I will fix this later.
To make debugging easier, this also includes a visualizer for the incremental graph. I intend to keep this even in release builds so that if someone messes up their state, it can be explored or dumped.