Olivier Goffart
63a0d9308b
Bump version
2020-12-14 08:49:54 +01:00
Simon Hausmann
87e0cc7d85
Fix resource embedding doing a wasm build of a project using the sixtyfps! macro
...
We need to embed resources in wasm builds. Unfortunately we can't detect
that we're called by say wasm-pack and "TARGET"/"HOST" only works inside
build.rs. So instead, to keep things simple, this change always embeds
the image resources when targeting Rust.
The `SIXTYFPS_EMBED_RESOURCES` environment variable can be used to
override this anywhere for any language.
Fixes #130
2020-12-10 15:09:32 +01:00
Olivier Goffart
125ec13f24
Bump version numbers
...
Note: this does not update the documentation yet
2020-12-07 15:41:29 +01:00
Simon Hausmann
0788a33c9a
Fix online editor transition from errors to error free source
...
Markers are show inline when errors occur during compilation. But when
those errors are fixed, the markers should go away.
2020-12-07 15:02:14 +01:00
Simon Hausmann
8c477998dc
Load the logo in the examples off the website
...
This will allow moving them out of the repo and also makes the urls shorter.
2020-11-25 09:34:47 +01:00
Simon Hausmann
c258a907f0
Simplify event loop start-up
...
Move the layout constraint tracker into the window where we can apply
the constraints right before drawing, instead of doing that from within
the event loop. This allows to remove the component parameter from the
run function.
2020-11-12 15:04:48 +01:00
Simon Hausmann
5d744c86c2
Begin passing the VRC<ComponentVTable, Dyn> into the run-time library
...
First by changing the signature of run() and by adding a self_weak
to the C++ struct.
2020-11-11 18:31:51 +01:00
Simon Hausmann
02904c4014
Simplify signature of Component::run
...
We don't need to pass the root item anymore since ComponentVTable
has now get_item_ref.
2020-11-11 15:55:03 +01:00
Simon Hausmann
fb2f4d7508
Speed up the online editor loading
...
Split the monaco editor out into a separate JS bundle, which we can load in parallel with the wasm interpreter.
Previously we'd load a 2.x mb app.bundle.js and *then* the wasm interpreter.
2020-11-11 12:21:57 +01:00
Olivier Goffart
55f9641b84
Update the online editor syntax highlighting to take in account dashes in identifiers
2020-11-09 15:07:42 +01:00
Simon Hausmann
6a1cd307ff
Another small tweak to the hello world
...
Since this will be the first thing many people see, add a small comment inline about
logical pixels.
2020-11-09 10:24:10 +01:00
Simon Hausmann
dff5d8ab25
Minor tweak to the hello world in the online editor
...
Make the text slightly more readable by increasing the font size and showing
off css-style identifiers at the same time.
2020-11-09 10:21:02 +01:00
Olivier Goffart
c3ba10fa90
Syntax highlighting also in the secondary tabs
2020-11-03 19:38:08 +01:00
Olivier Goffart
21d2acf84c
Allow to import URL even if base_url is empty
2020-11-03 19:36:10 +01:00
Olivier Goffart
2ebc9d23fb
Fix syntax highlighting in the online editor
2020-11-03 12:42:07 +01:00
Simon Hausmann
fa077662c1
Remove stray debug output
2020-11-03 10:14:56 +01:00
Simon Hausmann
e3880d6aff
Save and restore view state when switching between tabs in the online editor
2020-11-03 10:14:11 +01:00
Simon Hausmann
7c4338a673
Fix typo and missing type annotations
2020-11-03 10:07:19 +01:00
Simon Hausmann
dc87898ca0
Support automatic compilation for all tabs in the online editor
2020-11-03 10:05:58 +01:00
Simon Hausmann
e0fd1259b3
Add support for viewing the contents of other tabs in the online editor
2020-11-03 10:02:11 +01:00
Simon Hausmann
47c99df775
Rework the tab model in the online editor
...
Store monaco editor models instead of the source code.
2020-11-03 09:52:18 +01:00
Simon Hausmann
2028723eee
online-editor: create tabs for each loaded document
2020-11-02 20:01:06 +01:00
Simon Hausmann
d435a7c8b8
Fix loading of images from imported files in the online editor
...
We need to separate the url resolution step from the document fetching,
as we need to keep the loaded url in Rust for further
resolution.
2020-11-02 14:57:49 +01:00
Simon Hausmann
330f61d6c1
Add support for loading external files in the wasm interpreter
...
The imported files don't have tabs though, and caching is done entirely
by the browser.
2020-11-02 13:46:58 +01:00
Simon Hausmann
ac5769b1db
Make the permalink visible again
2020-11-02 11:04:47 +01:00
Olivier Goffart
e4e7ae46f4
Support for for
in box layout in the interpreter
2020-10-31 11:24:31 +01:00
Olivier Goffart
fc9da9b8ea
Fix online editor errors while typing
...
the id was changed causing JS errors
2020-10-30 18:09:46 +01:00
Simon Hausmann
69029e2e49
Online editor tweak
...
Use a tab bar and show at least one tab with the main source file name
Also use bootstrap for the styling
2020-10-30 16:35:04 +01:00
Olivier Goffart
359f42c5f7
Prepare the compiler to be async
...
This will allow the online editor to load imports from URL asynchroniously later
Since currently the compiler is only working on a single thread, and that we
never await on a future that could block, it is allowed to use the spin_on executor
2020-10-30 15:00:04 +01:00
Olivier Goffart
20cfb65e53
Bump version
2020-10-22 08:41:45 +02:00
Olivier Goffart
65ec7e9b7d
Fix panic on parse error
...
Properly report the errors instead.
The later passes panic if the AST is not well formed
2020-10-19 19:43:13 +02:00
Simon Hausmann
04661913b1
Add support for markdown code fences in the syntax updater
2020-10-16 12:30:11 +02:00
Simon Hausmann
bacc43140d
Minor cleanup in syntax updater
...
Move the .rs file processing into a helper function as we'll add a .md one soon, too.
2020-10-16 12:30:11 +02:00
Simon Hausmann
6aa292eac1
Change the names of the logical and physical pixel units
...
The logical pixels are now just called "px" and the less frequently
used physical pixels have the "phx" suffix.
The existing markup was adapted using the syntax updater and the
following patch:
+ if node.kind() == SyntaxKind::NumberLiteral {
+ if node.text().ends_with("lx") {
+ return write!(
+ file,
+ "{}px",
+ node.text().as_str().split_at(node.text().as_str().len() - 2).0
+ );
+ }
+ if node.text().ends_with("px") {
+ return write!(
+ file,
+ "{}phx",
+ node.text().as_str().split_at(node.text().as_str().len() - 2).0
+ );
+ }
+ }
Fixes #49
2020-10-16 07:19:40 +02:00
Olivier Goffart
d57ad389e0
Default to the native style in the viewer if it is available
2020-10-14 14:51:47 +02:00
Olivier Goffart
1138c9dbed
Normalize the spelling of SixtyFPS
2020-10-13 07:48:55 +02:00
Olivier Goffart
cbf252f73b
Online editor: go back to hello world if no demo is selected
2020-10-12 12:25:34 +02:00
Olivier Goffart
0845b4ab85
Online editor: Add a timeout
2020-10-12 12:22:49 +02:00
Simon Hausmann
e374fd35c4
Ignore the generated pkg/ directory
2020-10-12 11:26:15 +02:00
Olivier Goffart
69b07eee53
Revert the changes to the hello world in the code editor
...
These were not meant to be commited
2020-10-10 15:46:38 +02:00
Olivier Goffart
e57554a71d
Missing license header
2020-10-10 13:20:13 +02:00
Olivier Goffart
8ec820cb9f
Online editor syntax highliting
2020-10-10 13:00:14 +02:00
Olivier Goffart
29f4910cbd
Some changes to the online editor
...
- Set a small hello world by default
- add a permalink
- allow to load an URL
2020-10-09 13:14:30 +02:00
Olivier Goffart
18881cfcad
Online editor don't ship with support for other languages
2020-10-09 12:48:56 +02:00
Simon Hausmann
67f387e628
Prepare for relative resource loading from the web
...
Pass the base url as path to the interpreter
2020-10-08 20:42:46 +02:00
Olivier Goffart
47ee896b57
Online editor: Ability to open any snippet passed in the query
2020-10-07 15:33:04 +02:00
Olivier Goffart
117e1d3389
Online-editor: Add a compilation button
...
Fixes #76
2020-10-07 15:12:38 +02:00
Olivier Goffart
f592a04f3d
Online code editor: load the demo from github
2020-10-06 13:03:51 +02:00
Olivier Goffart
c9d60d3575
Online editor: clear errors
2020-10-06 11:50:49 +02:00
Olivier Goffart
1f50e8c85e
Highlight the error in the online editor
2020-10-06 11:33:44 +02:00