-
-
Notifications
You must be signed in to change notification settings - Fork 914
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
feat: added support for browserified builds (closes #176) #293
Conversation
I use unpkg for development, but I suppose it'd work for prod. Never had any issues with it. jsdelivr might be better approach though. |
@styfle I have updated the PR to support jsdelivr |
cc @broofa |
@@ -56,7 +56,7 @@ Version 4 (random): | |||
|
|||
```javascript | |||
const uuidv4 = require('uuid/v4'); | |||
uuidv4(); // ⇨ '3a017fc5-4f50-4db9-b0ce-4547ba0a1bfd' | |||
uuidv4(); // ⇨ 'e57d7cee-a174-4463-9f89-1ada39083c5f' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this value change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #293 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the runmd module. tl;dr: 'Got fed up with broken README code samples. 'Wrote a utility to evaluate/annotate said examples. Said utility randomly generates UUIDs each time it's run because random is as random does.
When I run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼
My apologies for letting this gather dust, and just generally being unresponsive. By way of excuse/rationalization, the reason for this has been that this PR speaks to an issue have strong opinions about - the extent to which modules should/shouldn't bend over to deal with packager-related issues. Unfortunately my sentiments here don't align well with user interests. I feel bad about that and my conflict-avoidance response kicks in and, thus, PRs like this get neglected. As this PR demonstrates, supporting a particular form of packaging adds substantial dependencies, and introduces significant complexity. At the end of the day, dealing with such issues is more trouble than it's worth. I feel bad about that - I know it makes some users lives more difficult - but having to support the never-ending parade of packaging tools... AMD, UMD, CommonJS, ES6, Webpack, Browserify, Bower, Angular, Typescript, Rollup, and so on... it's just painful. I'm done with it. Sorry, I know that's not exactly "friendly", but I don't have the time/attention needed to deal with this class of problems. This is a Node/CommonJS-style module. Packagers either support that or they don't. If they don't, then that's an issue for the packager project. |
The service wzrd.in seems to be unmaintained for over a year now, see browserify/wzrd.in@2f7ea69 It currently throws 502 errors on all packages as reported in uuidjs#302 or https://talk.observablehq.com/t/wzrd-in-alternatives/571 As stated in uuidjs#293 (comment) there are no plans to support legacy bundlers. Instead, we may consider to go for properly standardized ES6 modules in the future as has been teased in uuidjs#317 However for the time being let's at least remove these broken instructions from the README. Closes uuidjs#176, uuidjs#302
* chore(doc): re-generate README * fix(doc): remove wzrd.in instruction from README The service wzrd.in seems to be unmaintained for over a year now, see browserify/wzrd.in@2f7ea69 It currently throws 502 errors on all packages as reported in #302 or https://talk.observablehq.com/t/wzrd-in-alternatives/571 As stated in #293 (comment) there are no plans to support legacy bundlers. Instead, we may consider to go for properly standardized ES6 modules in the future as has been teased in #317 However for the time being let's at least remove these broken instructions from the README. Closes #176, #302
I have added support for #176 in this pull request, and have also updated the README's browser usage section appropriately (specifically dropping wzrd.in in favor of unpkg.com).
Additional comments:
"unpkg"
version inpackage.json
which gets consumed by unpkg.com in order to serve as the default version when loaded via<script src="https://unpkg.com/uuid"></script>
husky
in order forcommitlint
to actually get used by contributors automaticallynpm-run-all
to keep thepackage.json
tidiereslint-plugin-compat
andcaniuse-lite
with a custom.dist.eslintrc
file that gets used to lint thedist
folder for browser compatibility specified in.browserlistrc
babelify
to ensure that the builds are built with babel, and@babel/preset-env
which lets us target browsers automatically in.browserlistrc
tinyify
to attempt to minify the dist outputs (see https://github.com/browserify/tinyify)