chrismbryant / amazon-confidence-interval

A browser extension which adds Bayesian visualizations to Amazon ratings.
MIT License
31 stars 4 forks source link

test.html doesn't work anymore #18

Closed musicin3d closed 4 years ago

musicin3d commented 4 years ago

I've attempted to fix this. I added type="module" to the script tag for calculations.js, but then it failed to find the stdlib file. I tried the full path to the file, but then Chrome complained that the file didn't provide a default export. I'm pretty sure Webpack does some extra work to make it easier on us. I thought about skipping the import altogether, but conditional imports are highly experimental and seemingly unsupported in Chrome. We may just need to delete test.html and find another way to experiment.

aeciorc commented 4 years ago

I'm not sure how you guys wanted to use test.html, but you could point to the bundled files directly, e.g: https://github.com/chrismbryant/amazon-confidence-interval/blob/test-html/src/shared/test.html

--Update-- I think the reason it doesn't work is because stdlib uses CommonJS modules, not es6 modules. I think you are right that webpack does some magic to let us uses "import" with cjs

aeciorc commented 4 years ago

(didn't meant to close the issue)

musicin3d commented 4 years ago

Personally, I just write what I need into the bundle and reload the page. But I would understand if someone else wanted to use Chrome's console to hack around. If Chris originally added the file, then I'd say it comes down to whatever is easy for him to work with. I want to respect that non-web developers might have a different workflow.

On Sat, Mar 28, 2020, 7:57 PM Aecio notifications@github.com wrote:

(didn't meant to close the issue)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chrismbryant/amazon-confidence-interval/issues/18#issuecomment-605540617, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICQTL7B6B57VYAEIHO5TDRJ2MGRANCNFSM4LVWTX7Q .

chrismbryant commented 4 years ago

Thanks for the consideration, @musicin3d ! Working on adding some visualizations today, I've adjusted my workflow to what you said (bundling and reloading), and that totally works fine for me. So I'll delete the test.html file in my next pull request