-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Provide browser compatible javascript package via CDN #3
Comments
is this possible with a build step at the moment? |
Possible once we merge #1108. |
Thinking out loud would the idea be that we create a full bundle with all the required dependencies? or would we expect users to, say add @solana/web3 in a separate script tag? |
A separate tag would be nice if there's any reason to have different versions (or even web3 libraries in the future), though I can't think of any examples where that would be useful atm. |
any update here? 🙇 |
Was a browser bundle created for anchor? I can't find it... |
nope. you'll have to bundle yourself. here's my implementation for reference |
It looks like somebody already did it? https://unpkg.com/@project-serum/anchor@latest |
this didn't work for me: https://unpkg.com/@project-serum/anchor@latest @mrmizz , I'll try it your way. What's the process for creating a browser bundle? Is there a tutorial you can recommend? |
@rmdorsey like yourself I did not have experience with browser bundles until I started developing with anchor-lang. |
Hi, I tried to use anchor on WebGL and found out WebGL can't install npm. For @solana/web3.js, I have successfully import the browser bundle following their tutorial in Getting Started -> Installation -> Bundle. I spot Browserify unpky skypack.dev tools provide feature that turn npm packages to browser bundle but all of these file and can't load on my browser. Tried the above unpkg too and it doesn't work too. Anyone can help me? |
We are going to use this for generating IDL in Light Protocol, so we will most likely also release it on crates.io (and maybe npmjs.org) and make Docker images based on it. Therefore, to avoid name collision, we need to change the names of crates in the least intrusive way. This change gives the `light-` prefix to all crates which are going to be published. Using them with the `package` option in Cargo.toml, like: ``` anchor-syn = { version = "0.27.0", package = "light-anchor-syn" } ``` is going to work as drop-in replacement for upstream Anchor without any necessity to change import paths (`use anchor_syn`). Also, mention the purpose of the fork in README.
Would be nice to use the @project-serum/anchor package directly in the browser without a build step, i.e., via
<script>
.The text was updated successfully, but these errors were encountered: