Giter VIP home page Giter VIP logo

ember-useragent's People

Contributors

bobisjan avatar buschtoens avatar camerondubas avatar ctjhoa avatar dependabot[bot] avatar duder-onomy avatar ember-tomster avatar lpaulger avatar mikidi avatar simonihmig avatar willviles 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

Watchers

 avatar  avatar  avatar

ember-useragent's Issues

Could not find module `ua-parser-js`

Out of (as far as I can tell) nowhere, this started happening.

loader.js:247 Uncaught Error: Could not find module `ua-parser-js` imported from `ember-useragent/services/user-agent`
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at requireModule (loader.js:24)
    at Class._extractDefaultExport (index.js:389)
    at Class.resolveOther (index.js:109)
    at Class.superWrapper [as resolveOther] (ember-utils.js:418)

[email protected]
[email protected]

Any suggestions? Thank you.

Not possible to install on Windows

I am not able to install this dependency on Windows 8.1.

$ npm install --save-dev ember-useragent
npm ERR! tar.unpack untar error C:\Users\<user>\AppData\Roaming\npm-cache\ember-useragent\0.2.0\package.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of chai@>= 2.1.2 < 5 but none was installed.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "ember-useragent"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! path C:\my_workspace\my-app\node_modules\.staging\ember-useragent-a9df5aa2\Icon
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

'pm ERR! enoent ENOENT: no such file or directory, open 'C:\my_workspace\my-app\node_modules\.staging\ember-useragent-a9df5aa2\Icon
'pm ERR! enoent ENOENT: no such file or directory, open 'C:\my_workspace\my-app\node_modules\.staging\ember-useragent-a9df5aa2\Icon
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\my_workspace\my-app\npm-debug.log

Updating from 0.6.1 to 0.7.1 causes the build to fail

After updating from 0.6.1 to 07.1 I'm encountering the following error:

while import node_modules/ua-parser-js/src/ua-parser.js: found an unknown transformation name cjs. Available transformNames are: amd

stack trace and error report:

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - codeFrame: [undefined]
  - errorMessage: while import node_modules/ua-parser-js/src/ua-parser.js: found an unknown transformation name cjs. Available transformNames are: amd
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: while import node_modules/ua-parser-js/src/ua-parser.js: found an unknown transformation name cjs. Available transformNames are: amd
  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: Error: while import node_modules/ua-parser-js/src/ua-parser.js: found an unknown transformation name cjs. Available transformNames are: amd
    at options.using.forEach.entry (/Users/lpaulger/Documents/myApp/node_modules/ember-cli/lib/broccoli/ember-app.js:1801:19)
    at Array.forEach (<anonymous>)
    at EmberApp._import (/Users/lpaulger/Documents/myApp/node_modules/ember-cli/lib/broccoli/ember-app.js:1792:23)
    at EmberApp.import (/Users/lpaulger/Documents/myApp/node_modules/ember-cli/lib/broccoli/ember-app.js:1765:10)
    at Class.included (/Users/lpaulger/Documents/myApp/node_modules/ember-useragent/index.js:9:15)
    at Class.superWrapper [as included] (/Users/lpaulger/Documents/myApp/node_modules/core-object/lib/assign-properties.js:34:20)
    at project.addons.forEach.addon (/Users/lpaulger/Documents/myApp/node_modules/ember-cli/lib/broccoli/ember-app.js:596:15)
    at Array.forEach (<anonymous>)
    at EmberApp._notifyAddonIncluded (/Users/lpaulger/Documents/myApp/node_modules/ember-cli/lib/broccoli/ember-app.js:594:25)
    at new EmberApp (/Users/lpaulger/Documents/myApp/node_modules/ember-cli/lib/broccoli/ember-app.js:151:10)

Add broccoli-debug

Add broccoli-debug, so the Broccoli pipeline is output to /DEBUG when the following command is run:

BROCCOLI_DEBUG=ember-useragent:* ember serve

Crash on Windows

The update from 6.1 to 7.1 produced the following crash in our program on Windows 10, right at the start of 'yarn':

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - codeFrame: [undefined]
  - errorMessage: Cannot read property '0' of null
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: Cannot read property '0' of null
  - name: TypeError
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: TypeError: Cannot read property '0' of null
    at Class.included (C:\Users\kaba\code\wavelength\node_modules\ember-useragent\index.js:8:82)
    at Class.superWrapper [as included] (C:\Users\kaba\code\wavelength\node_modules\core-object\lib\assign-properties.js:34:20)
    at project.addons.forEach.addon (C:\Users\kaba\code\wavelength\node_modules\ember-cli\lib\broccoli\ember-app.js:596:15)
    at Array.forEach (<anonymous>)
    at EmberApp._notifyAddonIncluded (C:\Users\kaba\code\wavelength\node_modules\ember-cli\lib\broccoli\ember-app.js:594:25)
    at new EmberApp (C:\Users\kaba\code\wavelength\node_modules\ember-cli\lib\broccoli\ember-app.js:151:10)
    at module.exports (C:\Users\kaba\code\wavelength\ember-cli-build.js:14:15)
    at Builder.setupBroccoliBuilder (C:\Users\kaba\code\wavelength\node_modules\ember-cli\lib\models\builder.js:51:19)
    at new Builder (C:\Users\kaba\code\wavelength\node_modules\ember-cli\lib\models\builder.js:29:10)
    at ServeTask.run (C:\Users\kaba\code\wavelength\node_modules\ember-cli\lib\tasks\serve.js:24:55)

The offending line index.js which produces 'Cannot read property '0' of null' is:

const modulePath = require.resolve('ua-parser-js').match(/node_modules\/.*$/)[0];

Any ideas?

property 'browser.supportsWebRtc'

Hi,

Would it be useful to have a property:

userAgent.get('browser. browser.supportsWebRtc'); // Boolean

Or do you want it to keept it close to the browser properties and not make conclusions that may have to be maintained?

What do you think?

KR,

Dimitri.

Deprecation: computed-property.override in _parser computed property

Using Ember 3.9.0, I get this deprecation warning:

''DEPRECATION: The <my-app@service:user-agent::ember220>#_parser computed property was just overriden. This removes the computed property and replaces it with a plain value, and has been deprecated. If you want this behavior, consider defining a setter which does it manually. [deprecation id: computed-property.override] See https://emberjs.com/deprecations/v3.x#toc_computed-property-override for more details.\n

isLinux in Firefox 59.0 false for Ubuntu

It seems like (at least the latest v59.0) Firefox does not return Linux as the os (On Ubuntu I get Ubuntu instead of Linux).

Chrome, however, returns Linux for me on Ubuntu as well, so here it works.

So, the userAgent.os.isLinux property returns false where it should be true.

Edge support?

Are there any plans to add userAgent.browser.isEdge, etc. any time soon?

Headless Chrome for Acceptance Tests

Any thoughts on either including Headless Chrome in the isChrome or some other related property? Was wondering why my acceptance tests failed after updating to the latest version of this component, and it turned out that Headless Chrome !== Chrome. For now, just checking the browser info.name for "Headless Chrome", but might be nice to capture it somehow .

Fix memory leak

This 'aint a particularly clever way of initializing UA-Parser inside the user-agent service.

Instead, we should reopen the service, and use the Fastboot service within a computed property to create the UA-Parser.

Pre-render for Fastboot and User Agent

I am using Prember with Fastboot, which does not seem to provide a user-agent when generating pages on build. This causes an error when the page it is trying to build is using the hbs helpers for user-agent.

pre-render / failed with exception: Error: Assertion Failed: No `user-agent` present in FastBoot headers.
{{#if (or (user-agent "device.isMobile") (user-agent "device.isTablet"))}}
  <MobileComponent />
{{/if}}

Is it possible to make ember-useragent not fail when no user-agent is present, but rather just return false for these helpers? Or maybe this is a Prember issue in that it should be providing some kind of user agent?

Build error updating to 0.7.0

When updating from 0.6.1 to 0.7.0 I'm seeing the following build error:

while import node_modules/ua-parser-js/src/ua-parser.js: found an unknown transformation name cjs. Available transformNames are: amd

Is there a missing dependency perhaps?

Error running ember-useragent with fastboot

This error is orcurring:

Error: Cannot find module 'ua-parser-js'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.require (/home/gabriel94/Documents/Simplificaa/soov2/node_modules/fastboot/src/ember-app.js:130:18)
at o. (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:4780:54)
at ze.Be.get (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:2342:20)
at Object.Se [as get] (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:2313:55)
at o.setupService (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:4780:170)
at o.init (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:4781:938)
at o.r [as init] (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:3201:9)
at new o (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:3106:21)
at Function.s.create (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:3117:44)
at e.create (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:1448:120)
at /home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:1434:103
at s (/home/gabriel94/Documents/Simplificaa/soov2/public/assets/vendor-ae758f968625e27cbcca8c95c95762ae.js:1440:45)

This error occurs only when the app is running after build with fastboot

Remove automatic injections

export function initialize() {
const application = arguments[1] || arguments[0];
application.inject('controller', 'userAgent', 'service:userAgent');
application.inject('component', 'userAgent', 'service:userAgent');
application.inject('route', 'userAgent', 'service:userAgent');
application.inject('view', 'userAgent', 'service:userAgent');
}

Initializers and implicit automatic injections are becoming somewhat of an anit-pattern lately. I would recommend to remove them.

I just got bitten by this, because I was tying to inject a service with a different name (native/user-agent) as userAgent, but got ember-useragents service, as it's auto-injected before.

Use ember-auto-import

Moving away from ember-cli-cjs-transform for importing ua-parser-js module in favour of ember-auto-import.

Unsure of the edge cases in using ember-auto-import in addons at the moment, so help wanted.

Try out the branch:

npm i -D git://github.com/willviles/ember-useragent.git#feat/ember-auto-import

or

yarn add --dev git://github.com/willviles/ember-useragent.git#feat/ember-auto-import

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.