jsonrpc-lite icon indicating copy to clipboard operation
jsonrpc-lite copied to clipboard

Add global jsonrpc ref for umd bundle and fix webpack warning

Open antongolub opened this issue 6 years ago • 11 comments

closes #15 closes #16

@zensh, could you review this PR?

antongolub avatar Oct 28 '19 21:10 antongolub

There's a bit trouble: microbundle > rollup-plugin-alias > slash "^3.0.0" that requires node >=8.

antongolub avatar Oct 29 '19 06:10 antongolub

@antongolub Could you remove microbundle ?

zensh avatar Oct 29 '19 09:10 zensh

Oh... build task requires microbundle to produce the all variety of packages: .js, .mjs, .umd.js and its maps. I'll try to separate build and test stages and assign proper runtime versions for each of them.

antongolub avatar Oct 29 '19 10:10 antongolub

Travis-ci has ability to cache directories between jobs/stages. But I cannot to make this feature work( This is very similar to issue #9814

Here's the config:

language: node_js
sudo: false

install: skip
before_install: skip
before_script: skip
script: skip

cache:
  directories:
    - ./target
    - target
    - node_modules

stages:
  - build
  - test

jobs:
  include:
    - stage: build
      node_js:
        - "12"
      install:
        - yarn install
        - yarn build
      script: skip
    - stage: test
      node_js:
        - "6"
        - "8"
        - "10"
        - "12"
        - "13"
      install: skip
      before_install: skip
      before_script: skip
      script:
        - yarn test

build stage adds files to target dir, but store build cache finds that "nothing changed" 604485316. So the next test stage outputs:

/home/travis/build/teambition/jsonrpc-lite/target
/home/travis/build/teambition/jsonrpc-lite/target is not yet cached

Any thoughts?

antongolub avatar Oct 29 '19 14:10 antongolub

"There is one cache per branch and language version" #caches-and-build-matrices @zensh, it seems there's no easy way to share target from nodejs_8 build stage for nodejs_6 test suite.

antongolub avatar Oct 29 '19 16:10 antongolub

@zensh And finally it works. I just raise NodeJs version at the build stage and return it back after. So the test validates bundles against v6.

install:
  - 'if [ "${TRAVIS_NODE_VERSION}" = "6" ] ; then nvm use 8 ; fi ;'
  - yarn install
  - yarn build
  - 'if [ "${TRAVIS_NODE_VERSION}" = "6" ] ; then nvm use "${TRAVIS_NODE_VERSION}" && node --version ; fi ;'

script:
  - yarn test

antongolub avatar Oct 30 '19 06:10 antongolub

@zensh, any objections?

antongolub avatar Nov 07 '19 16:11 antongolub

@antongolub Hi, I don't like microbundle.

zensh avatar Nov 10 '19 10:11 zensh

Ok... I'll try find another solution, but not right now.

antongolub avatar Nov 10 '19 10:11 antongolub

@zensh, I've replaced microbundle with several tsc scripts, amd and global polyfills.

antongolub avatar Nov 18 '19 10:11 antongolub

What's the latest here? Anything stopping this PR getting merged?

kyranjamie avatar Aug 27 '20 09:08 kyranjamie