Coder Social home page Coder Social logo

Comments (4)

liamcurry avatar liamcurry commented on June 3, 2024 1

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:

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.

nsjames avatar nsjames commented on June 3, 2024

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.

nsjames avatar nsjames commented on June 3, 2024

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.

nsjames avatar nsjames commented on June 3, 2024

Implemented and merged into master.
Thanks oodles for the help on this, made life super-easy.

#8

from scatter-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.