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

npm package #521

Closed
jnimety opened this issue Nov 29, 2017 · 5 comments
Closed

npm package #521

jnimety opened this issue Nov 29, 2017 · 5 comments

Comments

@jnimety
Copy link

jnimety commented Nov 29, 2017

I'd like to use just preview.js via npm/yarn but without React. Do you have any plans to provide an npm package of just box-content-preview?

@JustinHoldstock
Copy link
Contributor

Hey @jnimety,

I'm not sure that we have plans as of right now, to release Box Content Preview as its own NPM package. It's not ideal, but you could include the built scripts from our CDN (or download your own version and host) from
https://cdn01.boxcdn.net/platform/preview/VERSION/en-US/preview.js
and
https://cdn01.boxcdn.net/platform/preview/VERSION/en-US/preview.css

Right now we're on version 1.21.0

@jnimety
Copy link
Author

jnimety commented Jan 5, 2018

Ok, consider this a feature request. Managing a dependency like this outside of npm/yarn/etc is less than ideal. Thanks.

@keturn
Copy link

keturn commented Jan 9, 2018

Second this. Using npm to manage our packages helps with keeping track of our dependencies, providing visibility on available updates, and works with our compilation/bundling strategy to reduce the number of requests we need to make and the number of sites we have to whitelist on our security policy.

@keturn
Copy link

keturn commented Jan 9, 2018

I tried to download the preview.js and pull it into our bundle but that PREVIEW_LOCATION = findScriptLocation() trick makes it really hostile to being bundled.

@tonyjin
Copy link
Contributor

tonyjin commented Jan 9, 2018

Hey @jnimety & @keturn thanks for the feedback. We'll continue discussing this feature request internally.

Here are a few things we're thinking about:

  • Do we want to pull React into this project for cleaner UI for some of the more advanced viewers? If so, then there's overlap we'd have to consider with the UI Elements, which are already published to npm (https://github.com/box/box-ui-elements)
  • Clients shouldn't have to download the assets for all viewers (think several MB+ for 3D preview) when they only want to preview an image or document
  • Internationalization gets a bit trickier if we publish this package to npm

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

5 participants