Releases: fkling/astexplorer
v2.1.0
Goodbye Parse
This is the release that breaks with Parse. From now on, all URLs, i.e. also the old URLs (/#/abcdef/3
) are served via the astexplorer express app (665bfc4 and beb4cc0).
Thank you @ParsePlatform for getting astexplorer off the ground!
Other changes
- @lahmatiy added CSSTree as parser (87bc4f8)
- @Turbo87 added an additional transformer for Handlebars/glimmer (1f0d357)
- @mroch updated flow to v0.38 (ab0ecf1)
- The "Save" button is now also enabled
- if no snippet is loaded and no changes have been made to the cached or default content
- if a snippet is loaded and the parser was changed
v2.0.0
astexplorer 2.0
It's been a long time coming, but now it's here: astexplorer moved to Gists as storage backend!
Because Parse is shutting down, we had to find another solution for storing snippets. Using Gists as a backend has a couple of advantages, for example that is has a revision system built-in.
So how exactly does astexplorer and Gists work together?
When you are storing a snippet, a new secret gist created, owned by the astexplorer user that was created for just this purpose (storing the Gist under your account is coming in the future).
A gist contains up to three files:
astexplorer.json
: A JSON file containing meta-data, such as the selected parser or parser settings.source.[js,css,html,..]
: The file that contains the code/source.transform.js
: The transformer code, if a transformer was used.
These Gist snippets work pretty much the same as the Parse snippets:
- Everybody who knows the URL can access them.
- Everybody who knows the URL can make changes to them.
- Everybody can view every revision by going to the corresponding GithHub page.
Since all gists are secret, it's not possible to browse them.
There are some difference to Parse snippets as well, especially that revision are not numbered consecutively anymore. Things like these might be improved in the future. Please give us feedback so we can make gist integration in astexplorer a good experience.
In order to provide this service, astexplorer.net is now running on its own server (not GitHub anymore). That also gives us much more opportunities for future expansions.
What happens to the Parse snippets?
Existing snippets and URL will continue to work but you won't be able to save changes to the them. You can fork them though, which will create a new gist.
Other changes
There have been many other noteworthy changes:
-
New menu item: "Save" and "Fork" have been moved into a dropdown menu, "Snippet". That menu also provides two new entries "New" and "Share". "New" will reset the code and transforms to the default code examples. "Share" will show a dialog with copyable URLs to the loaded snippet.
A small "Save" or "Fork" button is available next to the "Snippet" menu header as a shortcut. -
URLs for accessing latest snippet version:
/<snippetid>/latest
instead of/<snippetid>/<revisionid>
now allows you to link to the latest revision of a snippet. This will be even more useful later when you can store gists on your GitHub account that only you can edit. -
Parser settings are stored in snippets: This should make sharing snippets better because it ensures that the other person uses the same configuration.
-
Last used transform is loaded on visit: Just as the last used parser is automatically selected, the last used transform is now selected as well.
-
Restoring previously entered code: If you entered code and didn't save, coming back to the site will now restore the code from local storage.
-
More parsers: @skratchdot, @mohsen1 and @Turbo87 have been adding parsers for sqlite, YAML and handlebars.
v1.13.0
New
Updated jscodeshift to v0.3.26
Since v0.3.21, jscodeshift also supports babylon
(v6) and flow
as parsers. astexplorer was updated to respect the parser
export in the transform. I.e. you can now add
export const parser = 'flow';
to the transform and jscodeshift will use that parser: http://astexplorer.net/#/uIl3Ja2nAO
Babylon and flow have been added as additional parser options to recast
.
Note: If you change the parser in the transformer, you should also select the corresponding parser in the recast settings to properly reflect the AST:
Open preferences:
Select parser:
I also added a simple implementation for the stats
API method. When used, it will log the collected values to the console: http://astexplorer.net/#/u2ALD6fmMy (open the browser console):
Selected node indicator
A probably lesser known feature is that the just opened node in the tree view is available in the console (global scope) via $node
. The tree view know shows a = $node
after the name to indicate that.
Parser updates
Fixes
- Bring back jscodeshift code completion (b0742d7)
v1.12.1
v1.12.0
v1.11.0
v1.10.0
v1.9.0
v1.8.0
New: Code completion for jscodeshift
We now have rudimentary support for code completion for the following APIs, thanks to Tern.
- Type definitions (
j.Literal
) - Builders (
j.literal
) - Some
NodePath
methods (recast) - AST node field completion (if Tern can determine the type of the AST node)
- jscodeshift's core API
Commands:
- CTRL + Space: Show code completion
- CTRL + I (capital i): Show signature / definition / description
The API definition file is partially auto-generated. The manual part of it (which defines the methods for recast, ast-types and jscodeshift's core API) is still missing some descriptions and methods, if anybody wants to help out :)
The integration with Tern is a bit hacky, but in the long run I hope we can provide similar support for other transformers.