Skip to content
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

Is there just a list of the overrides in case we are hit with out of memory issues? #85

Open
NullVoxPopuli opened this issue Jul 10, 2024 · 4 comments

Comments

@NullVoxPopuli
Copy link

I can't use the CLI, because even with 32G of max-old-space-size, I get the OOM error, reported here: #33

We don't need a CLI -- we can copy-paste a list of overrides -- any packages we don't actually use would no-op.

@imcotton
Copy link

imcotton commented Jul 11, 2024

I made a lightweight CLI1 with performance in mind that integrating meta data of nolyfill as one of presets.

Basically it streaming lockfile line-by-line by doing plain filtering on package names and nothing more. Still in earlier stage, feedback is welcome.

Footnotes

  1. https://jsr.io/@imcotton/pkg-fence

@SukkaW
Copy link
Owner

SukkaW commented Jul 11, 2024

Basically it streaming lockfile line-by-line

Stream parsing is almost impossible for YAML format (which is the format of pnpm-lock.yaml).

@imcotton
Copy link

Yes, support all kinds of lockfiles would be an epic effort, thus I'd shortcut by calling npm shrinkwrap and use npm-shrinkwrap.json as single source of truth, at least for now.

@imcotton
Copy link

imcotton commented Jul 20, 2024

const headers = { 'Content-Type': 'text/html' };

const html = `

<!doctype html>

<head>
    <script type="importmap">
      {
        "imports": {
          "pkg-fence/": "https://esm.sh/jsr/@imcotton/[email protected]/"
        }
      }
    </script>
    
    <script type="module">
    
        import { nolyfill } from 'pkg-fence/presets';
    
        console.log(nolyfill.list.length);
        console.log(nolyfill.list.slice(0, 5));
        console.log(nolyfill.check('hasown'));
    
    </script>
</head>

<body>
    <p>hello, JSR via esm.sh</p>
</body>

`;

export default {
    fetch () {
        return new Response(html, { headers });
    },
};

For sake of demonstration, save above code snippet as demo.js and try:

deno serve demo.js

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

No branches or pull requests

3 participants