Skip to content

Comments

refactor: simplify try_rewrite_import_expression control flow#7753

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-05-refactor_simplify_try_rewrite_import_expression_control_flow
Jan 5, 2026
Merged

refactor: simplify try_rewrite_import_expression control flow#7753
graphite-app[bot] merged 1 commit intomainfrom
01-05-refactor_simplify_try_rewrite_import_expression_control_flow

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Jan 5, 2026

Use let else instead of if let Some() = xxx pattern to reduce the control flow which make the code more readable.

Copy link
Member Author

IWANABETHATGUY commented Jan 5, 2026


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

Benchmarks Rust

  • target: 12-22-feat_4905(8257a30)
  • pr: 01-05-refactor_simplify_try_rewrite_import_expression_control_flow(77768f5)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.01     65.2±2.05ms        ? ?/sec    1.00     64.7±1.99ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.01     70.9±1.41ms        ? ?/sec    1.00     70.1±1.34ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    106.7±2.57ms        ? ?/sec    1.00    106.7±2.38ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.01    119.1±1.62ms        ? ?/sec    1.00    117.9±1.51ms        ? ?/sec
bundle/bundle@threejs                                        1.01     38.9±2.41ms        ? ?/sec    1.00     38.6±0.75ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.01     43.6±0.94ms        ? ?/sec    1.00     43.4±0.97ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    391.5±5.68ms        ? ?/sec    1.00    392.7±6.58ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    451.0±4.66ms        ? ?/sec    1.00    450.9±5.75ms        ? ?/sec
scan/scan@rome_ts                                            1.02     86.4±2.12ms        ? ?/sec    1.00     85.0±1.85ms        ? ?/sec
scan/scan@threejs                                            1.00     29.0±0.49ms        ? ?/sec    1.00     29.0±0.89ms        ? ?/sec
scan/scan@threejs10x                                         1.00    300.2±5.59ms        ? ?/sec    1.00    299.3±5.08ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-05-refactor_simplify_try_rewrite_import_expression_control_flow branch from 9daada4 to 65c52c5 Compare January 5, 2026 10:13
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 5, 2026

Merge activity

Use `let else` instead of `if let Some() = xxx` pattern to reduce the control flow which make the code more readable.
@graphite-app graphite-app bot force-pushed the 01-05-refactor_simplify_try_rewrite_import_expression_control_flow branch from b609f15 to 77768f5 Compare January 5, 2026 12:22
Base automatically changed from 12-22-feat_4905 to main January 5, 2026 12:41
@graphite-app graphite-app bot merged commit 77768f5 into main Jan 5, 2026
37 checks passed
@graphite-app graphite-app bot deleted the 01-05-refactor_simplify_try_rewrite_import_expression_control_flow branch January 5, 2026 12:43
This was referenced Jan 7, 2026
shulaoda added a commit that referenced this pull request Jan 7, 2026
## [1.0.0-beta.59] - 2026-01-07

⚡ Inline Dynamic Imports for Statically Imported Modules

- When a module is already statically imported, dynamic imports to that same module are now inlined instead of creating a separate chunk

### 🚀 Features

- plugin_timings: add 3s threshold and doc link to warning message (#7741) by @shulaoda
- improve treeshaking logic to handle empty parameter list in dynamic import .then() callbacks (#7781) by @Copilot
- dev/lazy: don't include already executed modules (#7745) by @hyf0
- dev/lazy: support dynamic `import(..)` (#7726) by @hyf0
- inline dynamic imports that imports statically imported modules (#7742) by @IWANABETHATGUY
- option: add experimental option to control chunk optimization (#7738) by @IWANABETHATGUY

### 🐛 Bug Fixes

- inline dynamic entry to user defined entry with esm wrap kind (#7783) by @IWANABETHATGUY
- use canonical namespace reference for property access (#7777) by @IWANABETHATGUY
- dynamic entry merged into common chunk with cjs and esm wrap kind (#7771) by @IWANABETHATGUY
- tla: should not await non-tla-related modules (#7768) by @hyf0
- dynamic entry captured by common chunk with CJS format (#7757) by @IWANABETHATGUY
- module_loader: mark emitted chunks as user-defined entry when already loaded (#7765) by @shulaoda
- normalize preserveModulesRoot path (#7737) by @IWANABETHATGUY
- linker: resolve race condition in side effects computation for export-star (#7728) by @camc314

### 🚜 Refactor

- plugin_timings: filter out plugins with duration < 1s from timing warnings (#7785) by @shulaoda
- module_loader: remove unnecessary collect before extend (#7769) by @shulaoda
- rename _id suffixes to _idx for oxc_index types (#7767) by @IWANABETHATGUY
- remove duplicate `preserve_entry_signatures` from `AddEntryModuleMsg` (#7762) by @shulaoda
- module_loader: pass `user_defined_entries` by reference (#7756) by @shulaoda
- dev/lazy: get proxy entry's `ResolvedId` correctly (#7746) by @hyf0
- simplify try_rewrite_import_expression control flow (#7753) by @IWANABETHATGUY
- module_loader: remove unnecessary dynamic import handling for runtime module (#7754) by @shulaoda
- inline __toDynamicImportESM  (#7747) by @IWANABETHATGUY
- use From impl for ModuleLoaderOutput conversion (#7732) by @shulaoda
- remove duplicate fields from `ModuleLoader` (#7731) by @shulaoda
- tweak `resolve_user_defined_entries` (#7727) by @shulaoda

### 📚 Documentation

- add rolldown-string reference to native MagicString compatibility section (#7778) by @Copilot
- improve comments for export star side effects handling (#7730) by @IWANABETHATGUY

### 🧪 Testing

- use assertion instead of console.log for some testcase (#7744) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- tweak some `output.dynamicImportInCjs` related rollup test results (#7776) by @sapphi-red
- mark esbuild/dce/dce_of_symbol_ctor_call as passed (#7775) by @sapphi-red
- deps: update oxc apps (#7772) by @renovate[bot]
- vite-tests: allow running on PRs with `test: vite-tests` label (#7770) by @shulaoda
- deps: update oxc apps (#7760) by @renovate[bot]
- deps: update rollup submodule for tests to v4.55.1 (#7763) by @sapphi-red
- deps: update test262 submodule for tests (#7764) by @sapphi-red
- deps: update oxc to v0.107.0 (#7758) by @camc314
- deps: update taiki-e/install-action action to v2.65.13 (#7751) by @renovate[bot]
- deps: update rust crates (#7750) by @renovate[bot]
- deps: update npm packages (#7749) by @renovate[bot]
- deps: update github-actions (#7748) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.10.1 (#7729) by @renovate[bot]
- deps: update crate-ci/typos action to v1.41.0 (#7725) by @renovate[bot]

Co-authored-by: shulaoda <[email protected]>
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