question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Able to choose between component/xcomponent.frame when importing

See original GitHub issue

Hello,

We’re using xcomponent (which is an awesome library, good work!) in a TypeScript/webpack project which means we use npm to install xcomponent and then import it: import * as xcomponent from 'xcomponent'

The problem is we want to use the xcomponent without the ie-bridge since it causes errors in IE11 (somehow it thinks we want to use the bridge even though we don’t use popups). I don’t think we need to dig in this bug since without the IE-specific bridge code it works. If we look how react solves this (dev build vs prod build) they use environment variables to be able to choose which build should be included: https://github.com/facebook/react/blob/master/packages/react/npm/index.js

I was thinking if this might be a good idea for xcomponent as well? Maybe introduce a environment variable and let the user choose if one wan’t to import the whole thing or without iframe support?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
n00b2pr0commented, Aug 8, 2018

I’m using webpack as well and recently changed the xcomponent dependency to zoid. I saw the build size more than double, a similar experience as @doublemarked. I’m still debugging, but found myself on this issue and wanted to note my findings.

xcomponent 6.0.49 was the previous install version.

0reactions
jimmyncommented, Apr 1, 2020

I’m having the same issue.

This does not work, zoid is undefined

import zoid from 'zoid/dist/zoid.frameworks';

This does not work either

import * as zoid from 'zoid/dist/zoid.frameworks';

This somehow works:

const zoid = require('zoid/dist/zoid.frameworks');

I’m using “zoid”: “9.0.42”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Edit main components - Figma Help Center
Find main components · Select an instance in the current file. · Open the Design tab in the right sidebar. · Click in...
Read more >
react-frame-component - npm
How to use: import Frame from 'react-frame-component'; Go check out the demo. const Header = ({ children }) => ( <Frame> <h1>{children}</h1> </ ......
Read more >
Work with components - Adobe Support
Right-click a Component in the Assets panel and select Edit Main Component. Property Inspector. From the Property Inspector.
Read more >
Framer for Developers
Likewise, canvas and code components you create are now easier to share between projects because you can import them from an URL like...
Read more >
Component (Java Platform SE 7 ) - Oracle Help Center
A component is an object having a graphical representation that can be displayed on the ... Therefore if the component is moved from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found