Skip to content

fix: share replace global define config#1902

Merged
IWANABETHATGUY merged 5 commits intomainfrom
fix/share-replace-global-define-config
Aug 8, 2024
Merged

fix: share replace global define config#1902
IWANABETHATGUY merged 5 commits intomainfrom
fix/share-replace-global-define-config

Conversation

@IWANABETHATGUY
Copy link
Member

Description

@IWANABETHATGUY IWANABETHATGUY marked this pull request as draft August 8, 2024 07:20
@netlify
Copy link

netlify bot commented Aug 8, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit fa31f5a
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/66b471a74688980008c2c41e

@netlify
Copy link

netlify bot commented Aug 8, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 1d95996
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/66b47fd426d6b30008f087b2

fs,
plugin_driver,
meta: TaskContextMeta {
replace_global_define_config: if !options.define.is_empty() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could just put ReplaceGlobalDefinesConfig in the options.define.

Copy link
Member Author

@IWANABETHATGUY IWANABETHATGUY Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I am hesitated to do that is if we want the raw NormalizedBundlerOptions in the future. For now the NormalizedBundlerOptions is almost 1:1 for rolldown.config.js. Is it worth to preserve 1:1 semantic of the original configuration?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need worried about that. The purpose of NormalizedBundlerOptions is make we happy, no need to dealing with something raw. However, the current implementation of the PR is also fine.

Copy link
Member Author

@IWANABETHATGUY IWANABETHATGUY Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then I will replace it until we find it is necessary to keep the config as is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we replace define with ReplaceGlobalDefinesConfig(but we need handle error and propagate errors), which will lead change all upstream function return types to Result<T>. let's merge it first.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2024

Benchmarks Rust

  • target: main(a7d58b4)
  • pr: fix/share-replace-global-define-config(1d95996)
group                                                               pr                                     target
-----                                                               --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol                     1.07     58.6±1.36ms        ? ?/sec    1.00     54.7±2.33ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify              1.01     75.9±1.17ms        ? ?/sec    1.00     74.8±2.45ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify-sourcemap    1.05     94.3±1.98ms        ? ?/sec    1.00     89.7±1.66ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap           1.05     64.6±1.55ms        ? ?/sec    1.00     61.7±1.18ms        ? ?/sec
bundle/bundle@rome-ts                                               1.04     98.7±1.60ms        ? ?/sec    1.00     95.3±0.93ms        ? ?/sec
bundle/bundle@rome-ts-minify                                        1.04    180.6±3.36ms        ? ?/sec    1.00    173.2±5.24ms        ? ?/sec
bundle/bundle@rome-ts-minify-sourcemap                              1.03    222.6±4.02ms        ? ?/sec    1.00    215.3±4.72ms        ? ?/sec
bundle/bundle@rome-ts-sourcemap                                     1.01    114.5±1.37ms        ? ?/sec    1.00    113.2±1.90ms        ? ?/sec
bundle/bundle@threejs                                               1.03     29.8±0.96ms        ? ?/sec    1.00     28.8±0.99ms        ? ?/sec
bundle/bundle@threejs-minify                                        1.08     72.5±2.56ms        ? ?/sec    1.00     67.0±2.25ms        ? ?/sec
bundle/bundle@threejs-minify-sourcemap                              1.14     95.1±2.33ms        ? ?/sec    1.00     83.4±1.55ms        ? ?/sec
bundle/bundle@threejs-sourcemap                                     1.09     40.3±0.91ms        ? ?/sec    1.00     37.0±0.48ms        ? ?/sec
bundle/bundle@threejs10x                                            1.02    325.2±3.74ms        ? ?/sec    1.00    319.0±4.45ms        ? ?/sec
bundle/bundle@threejs10x-minify                                     1.03   815.1±11.59ms        ? ?/sec    1.00   788.2±10.11ms        ? ?/sec
bundle/bundle@threejs10x-minify-sourcemap                           1.03   1050.0±9.41ms        ? ?/sec    1.00  1020.1±10.29ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                                  1.04    397.8±4.84ms        ? ?/sec    1.00    384.3±7.70ms        ? ?/sec
remapping/remapping                                                 1.00     33.5±0.74ms        ? ?/sec    1.00     33.4±0.69ms        ? ?/sec
remapping/render-chunk-remapping                                    1.00     83.1±0.49ms        ? ?/sec    1.00     83.3±0.47ms        ? ?/sec
scan/scan@rome-ts                                                   1.00     73.2±0.96ms        ? ?/sec    1.07     78.1±1.01ms        ? ?/sec
scan/scan@threejs                                                   1.00     20.6±0.24ms        ? ?/sec    1.06     21.8±0.26ms        ? ?/sec
scan/scan@threejs10x                                                1.00    207.3±1.79ms        ? ?/sec    1.03    214.5±2.66ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review August 8, 2024 08:23
@IWANABETHATGUY IWANABETHATGUY added this pull request to the merge queue Aug 8, 2024
Merged via the queue into main with commit eee1db0 Aug 8, 2024
@IWANABETHATGUY IWANABETHATGUY deleted the fix/share-replace-global-define-config branch August 8, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants