Dark gets better each week! Here is a brief list of the fixes, new features, and updates.
July 13th, 2020
- Secrets now work in Functions (#2724)
- When copying strings from live values, Dark now omits the quotes (Brian Chen, #2723)
- Renaming rebound variables now properly renames the variables in the right-hand side of the rebinding expression (Brian Chen, #2722)
- Added support for
Date::yearto the query compiler. (David Cooley, #2720)
- Ensure the autocomplete menu covers the play button (Brian Chen, #2717)
- Show unused functions in a different color (to signify that they are unused and can be deleted) (#2713)
- Show canvas name in the browser's title (useful if you've multiple canvases open) (#2708)
- Highlight duplicate fields in records in red to indicate an error (Brian Chen, #2705)
- Add support for
String::replaceAllto the query compiler (David Cooley, #2692)
- Typing a comma in a list will now complete the autocomplete (Mehmet Aydin Bahadir, #2650)
Documentation and tutorial changes
- The footer on https://darklang.com now points to many more Learning and Community pages
- Documentation now supports a Dark mode
- Greatly expand the "General Concepts" documentation (#175)
- Improve documentation around using vim with merlin (Felipe Milani, #2685)
- The repo has standardized on "allowlist" and "blocklist" #2636)
- Change the default branch on Dark repos to
- New PR template (#2632)
- Update the Pull Request code checklist
Weeks of 6/15/2020 and 6/22/2020
- There has been a significant restructure to the Dark project. We'll write more about this going forward: Paul has a new devlog that talks about it.
- We now have a status channel in the community Slack. You can join the Slack community here!
- The Dark repo is now source available. This hasn't been publicly announced yet, but you can now file issues directly, and also contribute.
- Added a contributing doc, showing how you can help if you don't know OCaml.
Date::hour_v1is now supported in the query compiler. (David Cooley, #2639)
- When code is not synced due to the server being unavailable, an error message correctly explains what happened (Felipe Milani, #2605)
HTTPClientrequests coming from Dark now time out after 30 seconds #2661
Week of 6/12/2020
Secrets are now available! Now you can store API keys, passwords and other sensitive information separately from the rest of your canvas. Secrets will appear in autocomplete in handlers across your entire canvas. They will appear redacted in traces and live values, so it's now easier to stream and screenshot your Dark code!
Onboarding and tooltip updates
- The styling of our tooltips and initial tutorial has been updated
- Tips are now available in the function space.
- More helpful links have been added to the avatar menu.
The SQL compiler now supports
The newest version of a function will now always appear first in autocomplete (Felipe Milani)
Standard library functions added:
- Detailed documentation is now available around workers and crons
- We've begun to create short videos explaining Dark concepts. They will be added throughout the documentation, and a full playlist is available on our Youtube channel.
Week of 6/5/2020
- Function references now appear when you're using a package manager function.
We've updated some tips and error messages.
- On 404s
- On functions that have not yet been run
- When attempting field access on a datastore
- If you attempt to access Dark via a browser other than Chrome we now link you to our experimental desktop client.
- Variables can now be converted to lists by pressing
- Added a
convert-if-to-matchoption to the command palette (Jelle Besseling)
- References are now shown in the order in which they appear (Jelle Besseling)
String::trimfunctions are now supported in the query compiler (David Cooley)
DB::getManynow returns an
- Added font-ligature for lambas (Daniel Sokil)
- Copy to cURL now uses single quotes instead of double quotes (Jelle Besseling)
- Standard library functions added:
We have started taking external contributions, thanks so much to all the folks who contributed. In addition to the user facing changes above, contributors also added:
- Switched the Dark repo from using
- Updated Linux defaults to make it easier for Linux users to compile and rebuild Dark (Grzegorz Gajos)
- Added tests (Felipe Milani, David Cooley, Jesse Besseling, Justus Moeller, Christopher Brandt, Aash Anand)
- Made documentation fixes (Daniel Afonso, Jesse Besseling)
- Added a guide to help contributors with writing code in OCaml
- Added a tutorial around writing clean error messages using the error rail
Week of 5/29/2020
- It's now possible to set a return type for functions. The return type will appear in the autocomplete and type errors will be displayed when necessary, making it easier to know that your functions work, and making it easier to use and understand functions. This means that your functions can also now use the Error Rail, if you set their return type to Result or Option.
- Datastores can now have fields named id. This was contributed by our first external contributor, Caleb H!
- A section around submitting external contributions (134)
- A guide around when and when not to use Dark (133)
- Expanded information about Datastore migrations (141)
- Documentation for the
- Made a few improvements to the Your First App tutorial (129, 130)
- Misc. spelling fixes (128, 136)
Week of 5/22/2020
- We've added more information to the sidebar! If you're not sure what a section in the sidebar is for, click on its name and more details will appear on the right side of your canvas.
- We've done some major infrastructure work behind the Cron scheduler, which significantly improved its performance. You should now see all Crons, including those with a 1 minute interval, running on time again.
- Return values and execution fade are no longer stale when taking functions on/off the error rail or when committing feature flags.
Thank you to everyone who contributed to our docs this week! As a reminder, our docs repo is public and all you need to do to contribute is submit a pull request.
- Added instructions for hosting static assets when not using an external framework. (119)
- Fixed a broken link on the Language Details page. (117)
- Added instructions on how to pause your cron once you're done with the Your First App tutorial. (122)
- New how-to pages:
- New tutorials:
Week of 5/15/2020
- We've added a Hello World tutorial that will show automatically for new accounts. It can also be accessed via the avatar menu.
- Package manager functions and their underlying code can now be accessed via the sidebar. These functions will appear in the autocomplete, and can be used like any other built-in function.
- It's now easier to add 404s to your canvas - the entire line is now clickable, instead of just the plus sign.
- Made a ton of small fixes to feature flags:
- The correct docstring now shows when a feature flag is selected
- Feature flag expressions now show the correct live value
- Feature flags are now correctly created after pressing
Cmd+ato select everything.
- Feature flags no longer incorrectly display the "code was not run executed in this trace" error message.
- 404s should no longer appear off-screen when added to your canvas.
- When possible, we now display more information where we were previously
- Clicking to go to an error on an infix function now works as expected.
- The command palette will no longer appear behind other handlers when opened.
- Reorganized our documentation site, breaking tutorials & samples into their own section.
- Added a From Python page to help developers familiar with Python learn Dark.
- Added three sample canvases:
- Added a Setting Up OAuth page to the Building Slack Apps section.
Week of 5/8/2020
- We now have Dark badges for your sites! Add a Made With Dark badge to your apps to establish your early Dark expertise 🎉
- Clicking on a link in the sidebar will now always jump you to the correct place on the canvas. This was a super annoying bug that we internally referred to as "the dreaded positioning bug", and it is finally fixed. A blog post will be out describing the horror show behind this next week.
- Copying & pasting now works properly for pipes! We'll no longer lose arguments when copying between piped and non-piped expressions.
- Re-ordering function parameters works again. You can drag a function parameter to change its order (and we'll reorder the callers too).
- When you invite people (go to Settings), we'll error properly if the invite failed.
- When you try to access Dark in Firefox or other browsers, we'll tell you it won't work instead of crashing.
- You can now drag much more of a handler to move it (now including the docstring and return value boxes)
- When clicking on traces with errors, we'll no longer incorrectly color the trace dots.
Result::map2and 5 other
Resultfunctions now goes to the error rail.
- When you press
,to add another entry to a list, we'll now support it on both sides of an existing
Week of 5/1/2020
- We now show you the exact execution path of a trace, making it easy to
understand what happened in that trace. See which code paths are executed,
false, and which patterns are matched. This should make it much easier to understand code at a glance.
- Fixed a bug that caused text to sometimes be selected in multiple handlers.
- It is now possible to drag both the return value and docstring fields on a handler.
- We have disabled the visual identifier for error traces, due to them turning all trace dots red. We plan to fix and re-enable in the future.
Week of 4/24/2020
- We've added
Http::setCookie_v2which handles the
expiresparameter properly. It also has much better error messages
Date::>=to the standard library
- Updated a few standard library functions:
String::containsis now supported in
- It is now no longer possible to create multiple datastores with the same name.
- Fixed an issue that causes Dark to crash when selecting while the autocomplete was available.
- We now support recursion! While it's been supported for a long time on the backend, you were unable to get live values for recursive functions in the editor. Now you can!
- When new traces are created while your editor is open, we'll now replace old traces with the new one (before we added all traces, which caused large canvases to crash).
- We've improved the loading time of the editor for apps with lots of 404s
- Some function docstrings now link to relevant documentation - more to come!
- Improved the documentation around setting up a custom domain
- Added a tutorial around creating new Asana projects and tasks via Slack
Week of 4/17/2020
- Traces can now be linked to directly.
- Pasting JSON into Dark now works in more cases
- The command palette keyboard shortcut has changed: you should now use
ctrl+s(we also support
ctrl+\, should it be helpful for folks with non-US keyboard)
String::slugify_v1to slugify correctly in all cases.
DB::queryfunctions now support
String::containsin their query block.
- The docstrings for
List::sortByComparatorwere updated to improve clarity.
- Fixed the return type for
DB::queryOne- it now correctly returns an
Option, and works properly with the error rail
- Fixed a bug with selecting dicts in feature flags
- darklang.com now displays properly on Safari
- Added and documented many Asana package manager functions.
- Added and documented a Mailchimp subscribe function
- Lots of small typos and corrections were made - thank you to everyone who reported them!
- Improved the documentation around
match, thanks to Nathan Lloyd Smith!
- Added a tutorial around creating new Trello cards via Slack
Week of 4/10/2020
We've done a lot of work to improve how quickly we can set up custom domains - if you want a custom domain to point to your Dark app, read the documentation to see how to do it.
We've realized that people had difficulty knowing that they need traces when they're editing functions, so we've added some in-editor pointers to it (call the function from elsewhere!)
We're working a lot on performance of the editor, especially when typing. We've optimized a lot of different parts of the app, mostly related to typing and changing code, some of which are 3x faster. We'll continue working on this.
The Dark CLI now suggests some common problems and solutions when auth fails, in response to a few instances of shell string handling surprising users
Bug fix: typing an infix operator will now always open autocomplete.
extract-variablenow works correctly with right to left selection.
Worker names no longer allow quotes - we noticed this causing ambiguity between sending and receiving of messages
Updated the return type for
- Added a separate section to the documentation for Building Slack Apps
- Added a tutorial for building a slack app that checks for new channels and posts them
- Added and documented many Trello package manager functions
Week of 4/3/2020
- New Dark accounts are now auto-populated with a USERNAME-gettingstarted canvas that demonstrates basic Dark functionality.
- Even more functions have been added to the standard library:
- We've done a redesign of the sidebar to be more consistent and prettier!
add-feature-flagoption in the command palette is now context aware
- The feature flag panel is now auto-focused when adding a new feature flag
- Added an autocomplete option for
OPTIONSin HTTP. This is especially useful for people doing preflight requests as part of
- Made it clearer that return values apply specifically to a trace
- Adding a function at the start of a pipe now works properly (before this, we lost the first argument)
- Text selection has been reworked and should work a lot better and have fewer bugs. In particular, double-clicking on a function name properly selects the function, and selecting with the mouse now works in all cases (that we could find!)
- Typing "." to make a field now always works, even if the autocomplete isn't ready
- Bug fix: double-clicking in text boxes now keeps your cursor there
- Bug fix: in a
Justpattern, the variable now has the right type in autocomplete
Error:toStringhas been deprecated (you can't call functions on type errors)
Week of 3/27/2020
We released a lot this week, hope you enjoy!
- We have re-released feature flags! Feature flags allow you change live code safely: write the new code that you want, choose the condition to use that code instead (just for your user? just if a header is passed? Just if a particular query string is provided?). Then switch to the new code or discard it, safely, without breaking anything.
- Feature flags can be created from the command palette.
- The keyboard shortcut for the command palette has changed to
- We've added a ton of standard library functions:
- Hyphens are now allowed in records/dicts, to make it easier to set HTTP headers
HTTP::respondwas renamed to
HTTP::response, to make it clearer that it creates a value.
- A bunch of edge cases around calling functions were fixed, especially for
functions which currently return
- Tab now moves you to the next editable space
- Disabled a few features while we re-work them:
- Create new function option in the autocomplete
- Mouse over database stats
- Added Your First Function and Your First External API Call
- Updated the Slack tutorial to discuss OAuth v2
Week of 3/20/2020
- Now you can give us more information about your Dark projects, and let us know if they're live. This helps us understand how we can make Dark better for you!
Significantly faster HTTP requests and canvas loading. We "fixed" this a few weeks ago, but only saw modest improvements. Yeah, there was a bug. So now it's fixed fixed: some HTTP requests have dropped from 3s to 70ms.
We've added lots of standard library functions:
Week of 3/13/2020
- We now tell you how to deal with the ErrorRail in the docstrings for functions
- We've started narrowing down the types in the autocomplete using types, and we now have some nice error messages for options which don't match the types
DB::queryfunctions) now support
- Performance: We've improved the load speed of your code on our servers by about 3x over the last few weeks, with the final change landing this week. This has the largest impact when loading the editor as all of your code loads then (though it is also less noticeable there as the JS overhead is higher than the DB overhead so 🤷🏽♀️)
- We have launched an alpha package manager, which allows re-using Dark functions from other users or canvases. Today, only Dark employees can add functions to the package manager. We've started with some commonly used Slack functions, but let us know via Slack or email if you have any requests - or your own functions you'd like to share.
+no longer causes extraneous characters to be placed
- Uploading static assets on Windows no longer fails for nested directories
- Adding a
letabove a pipe no longer results in unexpected behavior
We added a bunch of improved documentation, including:
- better docs for hosting static assets
- a new doc describing Datastores in more detail
- a new doc describing our (very limited) support for packages
- a new doc describing the HTTP client library
- a new doc describing how to respond to HTTP requests
Week of 3/6/2020
Invites! You can now invite people to Dark from within the app. (If you want your invitees to collaborate in your canvases, you still need to ask us though — coming soon). Click "Share Dark" to invite people!
There is now a link to documentation in the profile menu
You can now move around the canvas using your mouse. Just click and drag!
Added a bunch of functions:
Fixed a bunch of bugs:
- you couldn't type a comma in a list within a
- you couldn't type
|>to pipe at the end of functions with no arguments
- scrolling in the sidebar works again
- When calling
StaticAssets::serveLatestwith JSON files, we now return the JSON properly
- If you press enter at the end of a line in an
ifstatement, we no longer take you to the next line (this simplifies code like
if i < 10)
- Show when traces were not executed in
matches (we already do this elsewhere)
- you couldn't type a comma in a list within a
The command palette's documentation appears properly (press
ctrl-\to show the command palette)
You can now use
DB::query(and also in
- We now give better error messages when you try to use
- When you try to use invalid canvas names (e.g. with capital letters), we now error much better
- When backspacing function names, we now delete the version automatically, which makes it clearer what's being deleted.
Week of 2/28/2020
- Backspacing a comma in a list no longer deletes text to the right of the comma
- Fixed an issue where Crons occasionally continued to run after they were deleted
- Lists now wrap when they pass 120 characters
- A few fixes to traces that caused people to get really stuck:
- Fixed an issue where traces could occasionally vanish
- Fixed an issue where clicking a Play button on a function in a REPL would not cause a trace to appear
- Docs can now be accessed at https://darklang.com/docs
- Your first Cron and Your first Worker sections have been added to the Getting Started guide
Week of 2/21/2020
The canvas list has been moved into a Settings modal, accessed by mousing over your avatar and clicking Account.
A variety of issues were fixed around autocomplete:
- New variables now correctly display their type instead of Incomplete.
- Autocomplete now appears correctly for single-character variables.
- It was possible to get into a state where your variable was not added to autocomplete - this is no longer possible.
Added improved error messaging for missing return values on HTTP handlers and user functions.
- Having the experimental web platform flag turned on in Chrome should no longer cause broken functionality.
- The Delete Handler menu option has been changed to Delete, for clarity.
- A complete documentation restructure, including URL changes - old bookmarks may no longer work.
Week of 2/14/2020
Added a Welcome to Dark modal for new users
You can now click on the Command Palette
Function arguments can now be reordered
- You can now delete recursive functions
- We now show you when a value was not executed in this trace
- Live values are now shown in unexecuted
- Fixed a bunch of redirection bugs after log-in
- Support pasting more JS objects into records
- Fixed the documentation for
Date::parse(it returns a
- Fixed a few bugs around autocomplete appearing too little or too much
- Fixed a carat placement bug in pipes
- Loaded our font (Fira Mono) even if you don't have it installed locally
- Fixed some issues causing the editor to freeze:
- Dragging up to select text
- Repeated clicking in a variable
- Fixed some issues around copying
- Added a Getting Started tutorial to the documentation
Week of 2/07/2020
You can now reset your password (thanks to a switch to Auth0)
Released a new version of the Dark CLI (0.5). This is a required upgrade to upload static assets.
- Going forward, the Dark CLI will tell you when your CLI is out of date.
wrap-in-matchto the command palette
Added new functions:
Changing functions now keeps the old function's error rail setting
Significant improvement in cursor position
Moved our documentation to a new, more readable format
Documented how to set CORS in Dark
Week of 1/31/2020
You can now see a list of all of your canvases by mousing over your avatar.
Typing when text is highlighted now causes text to be replaced instead of inserted
Many function improvements, including:
- We now create functions without a default parameter. Apparently that was annoying.
- Functions now have a menu, and you can delete functions from there if they are unused)
- Sometimes the Add New Parameter action didn't work - fixed it.
User-created functions now show parameters in blanks
Improved load time of canvases with many traces
The cursor now stays in the right place when we reflow/reformat code dynamically, in almost every case.
Prevented you from creating two datastores with identical names
HTTP::setCookie_v1- v0 incorrectly URL encoded some fields and is now deprecated
Fixed an issue where text was sometimes not being properly displayed in the sidebar
Added a warning when trying to access Dark from a non-desktop or non-Chrome browser
- Created a Sharing Dark Projects guide
- Improved the steps at the beginning of the Guide to Building a Backend for a React SPA in Dark
Week of 1/24/2020
Errors/Incompletes now point to the cause of the error
We substantially improved keyboard entry:
- Special characters on international keyboards now appear correctly
- Infix functions as parameters to other functions work
- We believe backspace should now always work perfectly
- We've greatly improved how often the cursor appears in the right place
Performance and loading improvements for all programs
- The editor loads program data from the server much faster
- Workers run with much less overhead (and so higher throughput)
- Crons should be running more reliably
- HTTP requests are much much faster
- Programs with lots of functions or traces are especially improved
- Several issues with deleted functions and databases are now resolved
Copy/paste is way improved
- you can paste code from Dark into other programs
- you can paste code into many parts of Dark (varnames, strings, records, etc)
- most copy-paste issues should be solved
JSON::parse_v1which uses a
Resultin case of error (deprecated
More improvements to
- previews now work for all
- previews now work for all
- Fixed up/down arrow on fields
- Single entry autocompletes now work
Cmd-arrowwith shift now maintains selection
- Fixed renaming function parameters
- Fixed deleted text persisting when pressing delete
- Large traces are now properly displayed
- Commands (
Cmd/Ctrl-\) now work more reliably when selecting code
- We now allow you to use arbitrary field names
- You can now use a field even if you don't have a trace or the field does not exist in that trace
- We've automatically disabled Grammarly, as it was messing with our DOM
- The dark-cli now prints errors on failure
- A list of sample canvases. and descriptions has been added
Week of 1/17/2020
- We added
DB::query_v4, which allows you use arbitrary queries on your Dark datastores
- We also published a related blog post!
- You can now remove a
letwith the backspace/delete key
- Improved documentation around the Error Rail
- GitHub API! See our sample canvas demonstrating how to call the GitHub API
- Fixed an issue where deleted from the middle of a concatenated string would cause text to the right of the deletion point to be removed.
- We asked y'all to not make HttpClient calls to your Dark canvas from REPLs. We've made some infrastructural changes that fix the issue on our end, so you should feel free to do that now. This is useful if you want to create a HTTP trace without leaving Dark. (Note: please don't make HttpClient calls to Dark from HTTP handlers)
Week of 1/10/2020
- Fixed a bunch of issues around entering non ASCII characters, especially from
- accented 'o' and 'a' characters were not being recognized from Swedish keyboard layouts.
- € or £ weren't working
- shift + 2 was not being recognized.
- Fixed an issue where pressing delete in a match expression was causing the cursor to be placed incorrectly.
- Stopped erroring when functions are being renamed.
- Fixed an issue where the Omnibox was not clickable.
- Fixed an issue where the minimap was hiding the Dismiss Error button.
- Fixed a short regression where lambda parameters were not shadowing variables of the same name.
- Deprecated the
Date::subfunction and replaced it with
- Changed the behavior of new handler placement - they no longer appear directly on top of one another.
- Changed the behavior of partials - they are now abandoned when clicking away from a handler.
- Added the
HttpClient::functions - use
Crypto::sha1macto support talking to the Twitter API