Comments (6)
@WorldMaker thank you for your kind response. I was actually thinking about the same, and was going to look into it later this week, however since you're experiencing breakages, I will try to push a fix as soon as possible!
from javascript.
Luckily in this case it was a build server canary warning that I can ignore for now. :) (The real lesson for me right now is that the build server is currently ignoring package-lock.json
.) I've been using Typescript for a long while now, so feel free to reach out if you want a hand.
from javascript.
Phew! So I just pushed out the release with the fixes. The downside is that I had to remove global browser support. Any thoughts on non-hacky ways to support that functionality?
from javascript.
My first thought is to just drop global browser support, it seems better these days to encourage fellow developers to use a module system, then to let them continue to avoid them in 2017.
That said, I've seen a few options. The obvious and it will feel like a hack is just to always set the global: ;(window || global || {} as any).ulid = factory(prng)
.
A growing pattern is to output only/primarily ES2015 modules, use @std/esm to support the CommonJS-only versions of NodeJS, and use rollup (or babel or webpack, but for libraries it seems like rollup is the most common choice and easiest to configure to this particular library need) to build a dist JS file with a global export build from the ES2015 modules. (That just leaves AMD users out in the cold, which is possibly fine in 2017, but Typescript's --outfile
support for a concatenated single file AMD dist JS file works pretty well there; you could have a default tsconfig.json
for ES2015 modules and a secondary tsconfig.amd.json
for AMD output.)
from javascript.
So I used parts of your advise. I'm using tsc
to create the ES6+ compatible file, and the typings file. Then I use rollup
to output ES+ compatible file which works with CommonJS, AMD, and the browser. Let me know if you have any trouble with it!
from javascript.
Looks good to me. Thanks.
from javascript.
Related Issues (20)
- isUlid
- dist _index.js#L59
- License violation HOT 20
- Where is ulid.js HOT 3
- Support for RFC 4648 base32? HOT 2
- First and Last IDs for Timestamp HOT 4
- Is there a way to get the timestamp from a given ULID? HOT 3
- PRNG inconsistency HOT 1
- Crypto API isn't detected on alternative platforms HOT 5
- Monotonically Increasing Guarantee
- is_ulid(x) HOT 3
- Generate time from shortened ulid?
- Random bias?
- Not available in web workers
- Maintainers HOT 4
- Please Upgrade Your Package HOT 1
- Error in worker HOT 2
- issue 1
- issue2
- Decoding ULID string into bytes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascript.