Skip to content

Add JS rewriting rule to ignore import function rewriting #259

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented Apr 29, 2025

Fix #255

For some reason, we were missing one JS rewriting rule implemented in wabac: https://github.com/webrecorder/wabac.js/blame/364b6e2d329f5ff92d680b482ec4f7e2036d6603/src/rewrite/jsrewriter.ts#L181

This has been put into wabac.js at webrecorder/wabac.js#164 ; looks like we missed the opportunity to back-port this into our rewriting code. Most probably because we only focus on fuzzy rules and forgot to also consider these JS rewriting rules. I've updated the release checklist to also check this file.

I've also checked all other rules in this file and realized that we missed some other changes, not linked to this bug but still worth to include, so they are in a distinct commit.

To be merged after #257

@benoit74 benoit74 self-assigned this Apr 29, 2025
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (fef63f8) to head (baad1c3).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #259   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           39        39           
  Lines         2455      2455           
  Branches       331       331           
=========================================
  Hits          2455      2455           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benoit74 benoit74 marked this pull request as ready for review April 29, 2025 09:19
@benoit74 benoit74 requested a review from rgaudin April 29, 2025 09:24
@benoit74 benoit74 changed the base branch from upgrade-wombat to main April 29, 2025 13:11
@benoit74 benoit74 force-pushed the fix_js_import_rewrite branch from 788e4ae to baad1c3 Compare April 29, 2025 13:15
@benoit74
Copy link
Collaborator Author

Just rebased + added missing CHANGELOG entries

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.

JS rewriting abusively rewrite import function
2 participants