Git Product home page Git Product logo

ctrip-apollo-client's Introduction

zhihu email

🔭 🌱 👯 🤔 💬 📫 😄 ⚡🔭 🌱 👯 🤔 💬 📫 😄 ⚡ 🔭 🌱 👯 🤔 💬 📫 😄 ⚡

ctrip-apollo-client's People

Contributors

ddzyan avatar dependabot[bot] avatar lvgithub avatar qb2014 avatar shenlanchenwei avatar tiejunhu avatar unliar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ctrip-apollo-client's Issues

304 报了个error

apollo-client: pollingNotification error: Request failed with status code 304
304应该是使用缓存,但是却报了个error

Angular 10使用异常

我想在Angular 10 中使用这个客户端读取apollo 配置中心的配置信息。
在npm run build 时 出现以下异常:

ERROR in ./node_modules/@lvgithub/ctrip-apollo-client/src/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/robin/Regtics/regtics-web/node_modules/@lvgithub/ctrip-apollo-client/src'

ERROR in ./node_modules/@lvgithub/ctrip-apollo-client/src/index.js
Module not found: Error: Can't resolve 'path' in '/Users/robin/Regtics/regtics-web/node_modules/@lvgithub/ctrip-apollo-client/src'

hotValue() 里面给 configurations 里确实存在的 key 但是.value 取不到值

config :>>  {
  application: {
    appId: 'xxx',
    cluster: 'default',
    namespaceName: 'application',
    configurations: {
      NODE_ENV: 'development',
      HCAPTCHA_BASE_URL: 'https://hcaptcha.com',
    },
    releaseKey: 'xxx'
  }
}
configApollo :>>  {
  NODE_ENV: 'development',
  HCAPTCHA_BASE_URL: 'https://hcaptcha.com',
}

这个是配置,我取 hotValue('HCAPTCHA_BASE_URL:123') namespace 默认 application,然后取不到这个值,返回的是123说明走了 defaultValue 逻辑

Bug

async polling () {
let pollingCount = 1
while (true) {
this.info('polling count:', pollingCount++)
try {
await this.pollingNotification()
await sleep(2000) // 这里不加会阻塞事件循环 长链接进不来 this.pollingNotification()加的已经被catch掉了
} catch (error) {
this.error('polling error:', error)
await sleep(1000)
}
}
}

可以实现同步获取配置吗?

之前项目里的配置都存放在config.js文件里,其他地方使用都是直接import的,如果可以实现同步获取apollo配置的话,可以完美替换这种场景。

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.