Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

bundle.js isn't in the npm distribution anymore? #235

Closed
chriddyp opened this issue Nov 9, 2018 · 8 comments
Closed

bundle.js isn't in the npm distribution anymore? #235

chriddyp opened this issue Nov 9, 2018 · 8 comments
Labels
dash-type-bug Something isn't working as intended regression Worked in a previous version

Comments

@chriddyp
Copy link
Member

chriddyp commented Nov 9, 2018

In the latest version, the remote URL for the dash package isn't found:
image

This URL is specified in the external_url key here:

'external_url': (
'https://unpkg.com/dash-table@{}/dash_table/bundle.js'
).format(__version__),

Indeed, looking at the package that got uploaded, the dash_table folder is no longer there:
image

So, either dash_table/bundle.js needs to get put back or the external_url needs to get update to the new directory: https://unpkg.com/dash-table@3.1.4/lib/bundle.js

Now, it would be good if it was the former, so that we're standard across our libraries and across our dash-component-boilerplate project. That way, changes that we make to the boilerplate, like adding dev and prod versions of the bundle (done here: plotly/dash-component-boilerplate#8), can get easily incorporated into this project (related issue is #228)

cc @Marc-Andre-Rivet and @valentijnnieman

@chriddyp chriddyp added the dash-type-bug Something isn't working as intended label Nov 9, 2018
@Marc-Andre-Rivet
Copy link
Contributor

Sigh. I missed that one it seems..

Fwiw, if the package.json entry point is set correctly, we shouldn't have to pass the explicit path to unpckg for the default case.

I fail to see why we don't just output to a static directory like lib/, dist/, etc. and to a static filename like bundle, bundle.min, bundle.dev -- this whole python-like sub-directory scheme seems pointless and requires bits of code to map folders sprinkled everywhere (python init, webpack config, package.json, etc.). Am I missing the point?

@Marc-Andre-Rivet Marc-Andre-Rivet added the regression Worked in a previous version label Nov 9, 2018
@Marc-Andre-Rivet
Copy link
Contributor

Marc-Andre-Rivet commented Nov 9, 2018

@chriddyp To be blunt, the preferred setup you are describing makes it hard to make a well-built, clean npm package.

#225 (comment)

@chriddyp
Copy link
Member Author

chriddyp commented Nov 9, 2018

@Marc-Andre-Rivet - You are welcome to improve the system with a PR to dash and all of the accompanying packages :)

@chriddyp
Copy link
Member Author

chriddyp commented Nov 9, 2018

requires bits of code to map folders sprinkled everywhere (python init, webpack config, package.json, etc.). Am I missing the point

FWIW, that's why we have a component boilerplate and why we try to standardize on a structure

@chriddyp
Copy link
Member Author

chriddyp commented Nov 9, 2018

this whole python-like sub-directory scheme

The dash_table folder is what is included in the Python package. So, the bundle.js file needs to get included in there in order to be distributed.

image

So, since the bundle.js file is already in there, it made sense when I wrote this system (2 years ago!) for the NPM package to just reference the same file, rather than needing to keep another copy of the bundle.js in a separate lib folder.

@chriddyp
Copy link
Member Author

chriddyp commented Nov 9, 2018

To be blunt, the preferred setup you are describing makes it hard to make a well-built, clean npm package.

If we want to have multiple bundles (since we need to include it in dash_table/ for distribution), then just change the unpkg URL in __init__.py to point to the new location of the bundle you've created.

@Marc-Andre-Rivet
Copy link
Contributor

Made more constructive comments and suggestions here:
plotly/dash-component-boilerplate#38

@T4rk1n
Copy link
Contributor

T4rk1n commented Nov 9, 2018

I fail to see why we don't just output to a static directory like lib/, dist/,

The bundles are included in the package folder because we use pkgutil.get_data to retrieve the files no matter how they were installed on the python environment. Putting them elsewhere would break dash.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dash-type-bug Something isn't working as intended regression Worked in a previous version
Projects
None yet
Development

No branches or pull requests

3 participants