question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Velcro.Runtime package out of date?

See original GitHub issue

Hi,

Just trying to assemble the bundler for a project alongside the runtime (using the published npm packages), but I am hitting a few bumps with respect to their being inconsistencies between the expected resolverHost for @velcro/runtime and the actual resolverHost in @velcro/resolver-host-compound. (isCacheable seems to be missing in newer).

Looking at the versions, it does appear that @velcro/runtime is the only package that hasn’t been updated, so perhaps the types are just out of sync and the core runtime needs releasing? If not perhaps I am assembling these packages incorrectly, in which case perhaps you could point me in the right direction?

While I am at it, I am also not 100% sure what the best approach is for substituting real packages with the runtime.

Currently I am doing something along the lines of:

` const memoryHost = new Velcro.ResolverHostMemory( initialFiles, “compound_host_with_cache” ); const resolverHostUnpkg = new VelcroResolverHostUnpkg.ResolverHostUnpkg(); const resolverHost = new VelcroResolverHostCompound.ResolverHostCompound({ “https://unpkg.com/”: resolverHostUnpkg as any, [memoryHost.urlFromPath(“/”).href]: memoryHost });

const runtime = Velcro.createRuntime({ cache: _cache, injectGlobal: Velcro.injectGlobalFromUnpkg, resolveBareModule: async (a, b, name, d) => { if (name === “react”) return memoryHost.urlFromPath(“/react”).href; if (name === “react-dom”) return memoryHost.urlFromPath(“/react-dom”).href; if (name === “prop-types”) return memoryHost.urlFromPath(“/prop-types”).href;

  const res = await Velcro.resolveBareModuleToUnpkg(a, b, name, d);
  return res;
},
resolverHost, 
rules: [
   ...
    ]
  }

]

}); `

And then after assembling, I can do the following:

runtime.set(memoryHost.urlFromPath("/react").href, React); runtime.set(memoryHost.urlFromPath("/react-dom").href, ReactDom);

Although this might work, it doesn’t seem to be consistent with the bundler api, and also it doesn’t work for underlying webpack plugins like css-loader or style-loader. It would be nice to do this because stuff like sass-loader has tons of dependencies and is slow on first pass.

Any thoughts?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
alexswan10kcommented, May 16, 2020

Awesome. Will have a crack at getting this integrated next week.

Thanks again, really appreciate the work your doing 👍

1reaction
alexswan10kcommented, May 14, 2020
velcro.js:1 Uncaught (in promise) W: Graph building failed with errors:
No such directory file:/// at
 GraphBuilder.doAddUnresolvedUri:file:///index.js
    at Ar.buildGraph (https://run.plnkr.co/preview/cka6w8uox00073b6e2celqvo0/lib/velcro.js:1:176303)
    at async Object.e.execute (https://run.plnkr.co/preview/cka6w8uox00073b6e2celqvo0/lib/velcro.js:1:224134)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Discord prevents runtime unless updated, but official Manjaro ...
Discord prevents runtime unless updated, but official Manjaro and Arch packages are out of date. What should Manjaro users do?
Read more >
Microsoft Visual Studio 2010 Tools for Office Runtime update
Download the Visual Studio 2010 Tools for Office Runtime package now. ... virus-detection software that was available on the date that the file...
Read more >
valve index headset cable extension
Valve Index Headset Cable ExtensionRecommended Materials: USB splitter; Velcro; Zip ties (optional) USB extension cable; Setup: Take USB splitter and stick ...
Read more >
6 Movies That Were Banned And Why Ripene - vuvuvu.net
Eventually, these movies were pulled from stores, leaving the movie almost inaccessible for about 6 years until the runtime was slightly ...
Read more >
runtime package | Flux 0.x Documentation
The runtime package provides information about the current Flux runtime.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found