Comments (4)
Well if the goal is to support a ton of different blockchains and EOS sidechains then it might be worth considering using lerna. This is how Babel/React/Jest manage their packages and it allows for developers to pick and choose components:
- https://github.com/babel/babel/tree/master/packages
- https://github.com/facebook/react/tree/master/packages
- https://github.com/facebook/jest/tree/master/packages
Some example Scatter packages:
packages/
scatter-core/
scatter-plugin-bitshares/
scatter-plugin-eos/
scatter-plugin-ethereum/
scatter-plugin-steem/
scatter-plugin-telos/
Also are you sure it's necessary to export the .cjs
/.esm
/.min.js
files? Seems like all that's needed is for Babel to transpile the src/
directory to the dist/
directory and in package.json
set "main": "dist/scatter.js"
. Minification and bundling should be handled by developers IMO. I have an old proof of concept of how this + Lerna would work here if you'd like to take a look: https://github.com/liamcurry/gql/tree/master/packages
from scatter-js.
Indeed this is something I've considered and even talked about with a few others already. It wouldn't be quite as simple as adding a requirement in the constructor or something like that though as those dependencies would be bundled in the package regardless ( i'd assume, untested ).
What could end up happening is a build script could be set up which spits out multiple versions of scatter-js with blockchain suffixes ( -eos
, -eth
) however that might be limited in the future as more blockchains are added and combinations would want to be formed.
I'll definitely have to run some tests on constructor methods and see if requiring specific signature providers cuts down esm/cjs sizes, but likely it'll have to be handled manually for the pre-bundled browser versions.
from scatter-js.
I'm not that familiar with lerna itself but am with that structure, this looks like a great solution for importation of nodejs packages. I'll have to dig into this when time permits. Feel free to PR an example <3
Would this support also browser only imports ( CDN based ) in the same fashion?
from scatter-js.
Implemented and merged into master.
Thanks oodles for the help on this, made life super-easy.
from scatter-js.
Related Issues (20)
- Can't call eos contract by use WalletAPI CreateTransaction HOT 1
- TypeError: c is not a constructor
- eosjs2 naming confusion HOT 1
- signing arbitrary data HOT 1
- Repeat websocket connections causes WalletAPI to utilize closed old websocket HOT 5
- README broken links HOT 3
- Add custom network globe icon is broken in v. 12.0.0 HOT 3
- TypeError: ScatterJS.scatter.eosHook is not a function at ta.html:61
- Defining "ScatterJS.scatter.eos" Cannot call related methods
- Scatter not found in Firefox HOT 1
- Cannot read property 'getRawAbi' of undefined
- Can't connect to scatter from browser
- Blocking when sendTransaction in Tron HOT 1
- ES6 Proxy is not defined in IE11 and Old Chrome
- Detecting auth
- JSON parsing error when RelaySocket connect fails HOT 2
- When calling transact(eosio.msig), Firefox and Chrome caught exception that said firewalled. HOT 2
- 404 at https://relay.get-scatter.com/app/connect/nodejs_env
- ScatterCDN failed
- Whitelisting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scatter-js.