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

Split transports up, make the bundle smaller include transports separately #20

Open
9 of 14 tasks
mitra42 opened this issue Aug 19, 2019 · 5 comments
Open
9 of 14 tasks

Comments

@mitra42
Copy link
Collaborator

mitra42 commented Aug 19, 2019

As more transports get integrated into dweb-transports, and as the IA's UI team start looking at using dweb-archivecontroller which depends on dweb-transports, its become necessary to split up dweb-transports and make it lighter.

Solution will need ...

  • Work in nodejs
  • Work in browser via webpack
  • At some point work in browser via ES6 modules

Experimentation is in the 'split' branch, which may or may not always be working !

Steps might be ... (this section will be edited)

  • Pull out each transport to its own script (most are NOT ES6 Module compatable)

    • Ideally these will be the standard, maintained scripts that each transport supports
    • have TransportXxx.load() find the result of the <script> and wrap in its own API
    • figure out how to do this in nodejs,
      • maybe at the application level (where it chooses to pass e.g. "IPFS" to Transports.connect()
  • Split each transport, test in browser and node

    • IPFS - see below
    • gun - see below
    • http (splits out httptools or maybe include them always)
    • webtorrent - see below
    • wolk - see below
    • yjs
  • Move code from DA/archive.html and DM/internetarchive.js into DTS/Transports &/or shims

  • Cleanup - when this is done

  • figure out distribution mechanisms for

    • dweb-mirror shouldnt include IPFS/GUN etc by defaut, but needs way to add
    • dweb-archive bundled with DM, should not include node_modules or bundle with transports
    • dweb-archive on its own, needs to have all transports
@mitra42
Copy link
Collaborator Author

mitra42 commented Sep 8, 2019

IPFS

  • comment out in TransportIPFS
  • add in via document.write in archive.html
  • move into dist during install so dont get cross-origin warning relating to unpkg
  • make sure updated during updates on each platform

@mitra42
Copy link
Collaborator Author

mitra42 commented Sep 8, 2019

GUN

  • comment out in TransportGUN size before = 2.65Mb after = 2.61Mb
  • add in via document.write in archive.html
    • unclear how ?
  • move into dist during install so dont get cross-origin warning relating to unpkg
  • make sure updated during updates on each platform

@mitra42
Copy link
Collaborator Author

mitra42 commented Sep 8, 2019

WEBTORRENT

  • comment out in TransportGUN size before = 2.65Mb after = 2.61Mb
  • add in via document.write in archive.html
  • move into dist during install so dont get cross-origin warning relating to unpkg
  • make sure updated during updates on each platform

@mitra42
Copy link
Collaborator Author

mitra42 commented Sep 8, 2019

WOLK

  • comment out in TransportGUN size before = 2.65Mb after = 2.61Mb
  • add in via document.write in archive.html
  • Fails - as script doesnt generate a global
  • move into dist during install so dont get cross-origin warning relating to unpkg
  • make sure updated during updates on each platform

@mitra42
Copy link
Collaborator Author

mitra42 commented Sep 8, 2019

YJS

  • comment out in TransportGUN size before = 2.65Mb after = 2.61Mb
  • add in via document.write in archive.html
  • move into dist during install so dont get cross-origin warning relating to unpkg
  • make sure updated during updates on each platform

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