Skip to content

Conversation

@angelux
Copy link
Member

@angelux angelux commented Nov 4, 2025

Fixes & Improvements

Refactoring & Performance (New)

  • Modularize Vendor Logic: Centralized provider logic into a mapped structure, removing scattered regex and conditions.
  • Modern API Requests: Replaced XMLHttpRequest with modern fetch API and async/await.
  • Improve Observer Performance: Optimized element lookup in IntersectionObserver using a Map (O(1)) instead of array traversal (O(n)).
  • Data Attribute Parsing: Improved safety and readability of boolean attribute parsing.

Features & Options

TypeScript Migration

Other Updates

Testing

  • Updated and modernized browser.js tests.
  • Fixed async environment configuration for tests (added Babel runtime).
  • Added mocks for fetch and IntersectionObserver.

Maintenance

Reference Links

For more details, you can check: https://app.clickup.com/t/86b44hm62

@angelux angelux requested review from Digznav and EverStarck November 4, 2025 04:39
@angelux angelux self-assigned this Nov 4, 2025
@angelux angelux added Complexity: Minor Does not involve critical parts P2: Normal Priority Status: Pending Review Needs code review Type: Feature New feature or request labels Nov 4, 2025
@angelux angelux requested review from priscilamtzfraire and removed request for EverStarck November 5, 2025 17:08
@angelux angelux requested a review from Digznav November 13, 2025 18:43
Copy link

@Digznav Digznav left a comment

Choose a reason for hiding this comment

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

The fixes so far look good! But I still have a few comments:

  • Since you upgraded node to version 20, I strongly suggest to regenerate the lock file so it has the correct structure that's recommended for the version.

    rm -rf node_modules/ package-lock.json && npm install
    
  • When I ran npm test I got the following error:

    Uncaught exception in test/browser.js
    
    test/browser.js:9
    
    8: const virtualConsole = new VirtualConsole();
    9: virtualConsole.sendTo(console);
    10:
    
    TypeError: virtualConsole.sendTo is not a function
    
    › Object.<anonymous> (test/browser.js:9:16)
    
    ✘ test/browser.js exited with a non-zero exit code: 1
    ✔ server › should expose lazyframe()
    ─
    
    1 test passed
    1 uncaught exception
    

    So I checked the jsdom documentation and it seems that the correct method is forwardTo(). But after I replace it, I got even more errors. Not sure if the tests worked before all the updates. Can you take a look?

  • After I ran npm run build the dist/lazyframe.css file was modified, can you please commit the change?

@angelux angelux requested a review from Digznav November 21, 2025 23:57
Copy link

@Digznav Digznav left a comment

Choose a reason for hiding this comment

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

All good, just please resolve the merge conflicts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complexity: Minor Does not involve critical parts P2: Normal Priority Status: Pending Review Needs code review Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants