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

GraalVM: Improvements #42

Open
1 task
lemanschik opened this issue Dec 23, 2022 · 0 comments
Open
1 task

GraalVM: Improvements #42

lemanschik opened this issue Dec 23, 2022 · 0 comments

Comments

@lemanschik
Copy link
Owner

lemanschik commented Dec 23, 2022

Create ES4X Espresso like abstraction

Goals?

Be able to spin up es4x as also expresso workers via es4x. Needed to better guide coders.

Usage inside NodeJS Compatible Enviornment

await import(`./component-manager.js?launch=component:chromium&userdir=${resolvedId}`); // resolvedId => sessionId + url or proc path socket path

// note: launch returns watch
// note: install takes specifier returns resolvedId for fetch
// note: for simplicity each instruction inherited the prev so calling launch => fetch load launch
graal-node import('@component-manager/graal-node').then(({ fetch, load, launch })=>);
node import('@component-manager/node').then(({ fetch, load, launch })=>);
node import('@component-manager/chromium/chromium').then(({ fetch, load, launch }) => );
node import('@component-manager/chromium/puppeteer').then(({ fetch, load, launch }) => );
node import('@component-manager/chromium/playwright').then(({ fetch, load, launch }) => );
fetch(https://raw.githubusercontent.com/puppeteer/puppeteer/main/packages/puppeteer-core/src/revisions.ts).then(({ body })=>body.text().split('chromium: \'')[1].split('\',')[0])

'https://storage.googleapis.com',
'chromium-browser-snapshots/'
const {
 linux: 'Linux_x64',
 linux_x64: 'Linux_x64',
 mac: 'Mac',
 mac_arm: 'Mac_Arm'
 win32: 'Win',
 win64: 'Win_x64',
}
chrome-win, chrome-mac, chrome-linux
{
  chrome: {
    linux: '%s/chromium-browser-snapshots/Linux_x64/%d/%s.zip',
    mac: '%s/chromium-browser-snapshots/Mac/%d/%s.zip',
    mac_arm: '%s/chromium-browser-snapshots/Mac_Arm/%d/%s.zip',
    win32: '%s/chromium-browser-snapshots/Win/%d/%s.zip',
    win64: '%s/chromium-browser-snapshots/Win_x64/%d/%s.zip',
  },
  firefox: {
    linux: '%s/firefox-%s.en-US.%s-x86_64.tar.bz2',
    mac: '%s/firefox-%s.en-US.%s.dmg',
    win32: '%s/firefox-%s.en-US.%s.zip',
    win64: '%s/firefox-%s.en-US.%s.zip',
  },
};

const browserConfig = {
  chrome: {
    host: 'https://storage.googleapis.com',
  },

allign puppeteer and playwrite-chromium launch

If you want to use playwright and puppeteer together you need to use the playwright installer and supply the path to puppeteer.launch you may also want to place a symlink to /opt/google/chrome/chrome or the correct mappings for puppeteer.

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

1 participant