Posts

Showing posts from August, 2024

copilot Enterprise features for pull requests

Update (end Sept 24): Enterprise features now coming to Business license  Big news PR summaries and copilot chat in github now coming to Business licenses  copilot offers 3 subscription levels currently (August '24) Individual, Business and Enterprise ( see docs for details ) Enterprise adds some features such as PR Summaries, copilot chat in github.com, knowledgebase etc. only available in Enterprise. I'm especially interested in PR support. Done well I think it can be a "killer" feature of AI assistants (as well as test generation and code generation).  I want AI to be first reviewer of PRs. I want my AI PR reviewer to know all our coding standards, best practices, code conventions, be library aware, check security rules etc. and apply those in the PR. Be the first line of review. (yes, we get its input when writing the code, but PR review is a final checkpoint.) (yes, code linters etc can catch a lot of issues, so let the linters handle that) But it's not easy

react batch updates (sometimes :-) )

reactjs will batch multiple state changes made in the same event handler and react waits until all code in the event handler has run before processing state updates. For example an onClick() handler may run multiple state updates. Instead of re-rendering after each individual state update in the handler, react batches them and renders once; after the handler completes (see example 1 below). This behavior is known as "batching" But an important thing to realize is: "React will not batch updates if they're triggered outside of a React event handler, like in a setTimeout()" This means that debounced handler functions will not be able to take advantage of react batching. But we want debounce and batching both! 😠 Ok, you want it, you got it 😀. Here are some options since react batching won't work: 1. in your handler, change from setting multiple useState setStates to 1 state update, this could be achieved using a useReducer or setting a complex object in a use