Skip to content

Conversation

@zombispormedio
Copy link
Contributor

Upgrading swc_core to 39.0.3 to make the package with the next compat range @33.0.0 - < 40.0.0 (https://plugins.swc.rs/versions/range/426)

In this way, the package will be compatible with Next.js 15.5

Related to this #170 (comment)

Testing

$ cargo test
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.25s
     Running unittests src/lib.rs (target/debug/deps/lingui_macro_plugin-5a34ca36389b2e54)

running 102 tests
test options::lib_tests::test_config_optional ... ok
test options::lib_tests::test_strip_non_essential_fields_default ... ok
test options::lib_tests::test_strip_non_essential_fields_config ... ok
test options::lib_tests::test_config ... ok
test generate_id::tests::test_generate_message_id_with_context ... ok
test generate_id::tests::test_generate_message_id ... ok
test tests::imports::should_add_imports_after_directive_prologues ... ok
test tests::js_define_message::should_expand_macros ... ok
test tests::js_define_message::should_expand_values ... ok
test tests::js_define_message::should_kept_only_essential_props ... ok
test tests::js_define_message::define_message_should_support_template_literal ... ok
test tests::imports::js_should_process_only_elements_imported_from_macro2 ... ok
test tests::imports::js_should_support_renamed_imports ... ok
test tests::imports::js_should_process_only_elements_imported_from_macro ... ok
test tests::js_define_message::should_preserve_custom_id ... ok
test tests::js_define_message::should_transform_define_message ... ok
test tests::js_icu::js_dedup_values_in_icu ... ok
test tests::js_icu::js_icu_nested_in_choices ... ok
test tests::js_icu::js_choices_may_contain_expressions ... ok
test tests::js_icu::js_icu_diffrent_object_literal_syntax ... ok
test tests::js_icu::js_icu_nested_in_t ... ok
test tests::js_icu::js_icu_macro ... ok
test tests::js_icu::js_plural_with_offset_and_exact_matches ... ok
test tests::js_icu::js_should_not_touch_non_lungui_fns ... ok
test tests::js_icu::js_plural_with_placeholders ... ok
test tests::js_icu::js_should_not_treat_offset_in_select ... ok
test tests::js_t::js_continuation_character ... ok
test tests::js_t::js_dedup_values_in_tpl_literal ... ok
test tests::js_t::js_choice_labels_in_tpl_literal ... ok
test tests::js_t::js_should_not_touch_code_if_no_macro_import ... ok
test tests::js_t::js_newlines_are_preserved ... ok
test tests::js_t::js_custom_i18n_passed ... ok
test tests::js_t::js_should_kept_only_essential_props ... ok
test tests::js_t::js_should_not_touch_not_related_tagget_tpls ... ok
test tests::js_t::js_explicit_labels_in_tpl_literal ... ok
test tests::js_t::js_should_work_with_legacy_import ... ok
test tests::js_t::js_ph_labels_in_tpl_literal ... ok
test tests::js_t::js_support_message_descriptor_in_t_fn ... ok
test tests::js_t::js_support_template_strings_in_t_macro_message_with_custom_i18n_instance ... ok
test tests::js_t::js_substitution_in_tpl_literal ... ok
test tests::js_t::js_t_fn_wrapped_in_call_expr ... ok
test tests::js_t::support_id_and_comment_in_t_macro_as_call_expression ... ok
test tests::js_t::should_generate_diffrent_id_when_context_provided ... ok
test tests::js_t::support_id_in_template_literal ... ok
test tests::js_t::unicode_characters_interpreted ... ok
test tests::jsx::elements_without_children ... ok
test tests::jsx::elements_inside_expression_container ... ok
test tests::jsx::ignore_jsx_empty_expression ... ok
test tests::jsx::jsx_explicit_labels_with_as_statement ... ok
test tests::jsx::html_attributes_are_handled ... ok
test tests::jsx::jsx_preserve_reserved_attrs ... ok
test tests::jsx::jsx_nested_labels ... ok
test tests::jsx::jsx_should_suppor_legacy_import ... ok
test tests::jsx::jsx_template_literal_in_children ... ok
test tests::jsx::jsx_simple_jsx ... ok
test tests::jsx::jsx_with_custom_id ... ok
test tests::jsx::jsx_components_interpolation ... ok
test tests::imports::jsx_should_process_only_elements_imported_from_macro2 ... ok
test tests::imports::jsx_should_process_only_elements_imported_from_macro ... ok
test tests::imports::should_add_not_clashing_imports ... ok
test tests::jsx::jsx_with_context ... ok
test tests::imports::jsx_should_support_renamed_imports ... ok
test tests::jsx::jsx_expressions_are_converted_to_positional_arguments ... ok
test tests::jsx::jsx_values_dedup ... ok
test tests::jsx::production_only_essential_props_are_kept ... ok
test tests::jsx::keep_multiple_forced_newlines ... ok
test tests::jsx::use_js_plural_in_jsx_attrs ... ok
test tests::jsx::use_decoded_html_entities ... ok
test tests::jsx::quoted_jsx_attributes_are_handled ... ok
test tests::jsx::strip_whitespace_around_arguments ... ok
test tests::jsx_icu::jsx_icu ... ok
test tests::jsx_icu::jsx_icu_explicit_id ... ok
test tests::jsx::normalize_crlf_lf_cr ... ok
test tests::jsx_icu::jsx_icu_with_template_literal ... ok
test tests::jsx_icu::jsx_plural_preserve_reserved_attrs ... ok
test tests::jsx::use_js_macro_in_jsx_attrs ... ok
test tests::jsx::strip_whitespace_around_tags_but_keep_forced_spaces ... ok
test tests::jsx_icu::jsx_select_ordinal_with_offset_and_exact_matches ... ok
test tests::jsx_icu::jsx_plural_with_offset_and_exact_matches ... ok
test tests::jsx::non_breaking_whitespace_handling_2226 ... ok
test tests::jsx::jsx_explicit_labels ... ok
test tests::use_lingui::js_use_lingui_hook ... ok
test tests::jsx_icu::jsx_icu_nested ... ok
test tests::jsx::jsx_ph_labels ... ok
test tests::jsx_icu::production_only_essential_props_are_kept ... ok
test tests::runtime_config::should_use_provided_runtime_modules ... ok
test tests::use_lingui::support_nested_macro ... ok
test tests::jsx_icu::jsx_select_simple ... ok
test tests::use_lingui::should_process_macro_with_matching_name_in_correct_scopes ... ok
test tests::jsx_icu::jsx_select_with_expressions_in_cases ... ok
test tests::jsx_icu::jsx_select_with_reserved_attrs ... ok
test tests::use_lingui::support_nested_macro_when_in_arrow_function_issue_2095 ... ok
test tests::use_lingui::support_renamed_destructuring ... ok
test tests::use_lingui::work_when_t_is_not_used ... ok
test tests::use_lingui::support_passing_t_variable_as_dependency ... ok
test tests::use_lingui::work_with_components_defined_as_arrow_function ... ok
test tests::use_lingui::work_with_existing_use_lingui_statement ... ok
test tests::jsx_icu::multiple_new_lines_with_nbsp_endind ... ok
test tests::use_lingui::work_with_multiple_react_components ... ok
test tests::jsx::strip_whitespaces_in_jsxtext_but_keep_in_jsx_expression_containers ... ok
test tests::jsx_icu::jsx_trans_inside_plural ... ok
test tests::jsx_icu::jsx_multivelel_nesting ... ok

test result: ok. 102 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s

Tested with the example updating it to Nextjs 15.5

npm run build:local-binary

> [email protected] build:local-binary
> USE_LOCAL_PLUGIN_BINARY=true next build

   ▲ [Next.js](http://next.js/) 15.5.7
   - Experiments (use with caution):
     · swcPlugins

 ✓ Linting and checking validity of types    
   Creating an optimized production build ...
 ✓ Compiled successfully in 5.0s
 ✓ Collecting page data    
 ✓ Generating static pages (6/6)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (pages)                                Size  First Load JS    
┌ ƒ /                                       724 B        87.9 kB
├   /_app                                     0 B        87.2 kB
└ ○ /404                                    180 B        87.3 kB
+ First Load JS shared by all             88.1 kB
  ├ chunks/[framework-37f3832b4337c515.js](http://framework-37f3832b4337c515.js/)  44.8 kB
  ├ chunks/[main-729f40dfc08aa5c9.js](http://main-729f40dfc08aa5c9.js/)       36.7 kB
  └ other shared chunks (total)           6.54 kB

○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand

Copilot AI review requested due to automatic review settings December 6, 2025 16:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades swc_core from version 27.0.6 to 39.0.3 to enable compatibility with Next.js 15.5, targeting the SWC plugin compatibility range @33.0.0 - < 40.0.0. The upgrade includes transitive dependency updates in the Cargo.lock file, with all 102 tests passing and successful build verification with Next.js 15.5.

Key Changes:

  • Updated swc_core dependency from 27.0.6 to 39.0.3 in Cargo.toml
  • Updated Cargo.lock with new dependency versions (serde, swc_* crates, and various internal dependencies)
  • Added compatibility table entry in README.md for the new version

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
README.md Added new row to compatibility table documenting swc_core 39.0.3 usage for plugin version 5.7.0
Cargo.toml Updated swc_core dependency version to 39.0.3
Cargo.lock Updated dependency tree with new versions of swc_core and transitive dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.45%. Comparing base (5b50317) to head (ff5a4a7).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #171   +/-   ##
=======================================
  Coverage   92.44%   92.45%           
=======================================
  Files           8        8           
  Lines        1364     1351   -13     
=======================================
- Hits         1261     1249   -12     
+ Misses        103      102    -1     
Flag Coverage Δ
unittests 92.45% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrii-bodnar andrii-bodnar merged commit cef0042 into lingui:main Dec 8, 2025
9 checks passed
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