-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Create a shortcut editor for the notebook. #1347
Conversation
Should preact be a runtime dependency instead of a dev dependency? |
Likely yes, reflect of |
reflex*, and it will be bundled in the min.js that will generated by webpack and be shipped, so not actually not sure. |
702802b
to
032b3ff
Compare
@@ -27,5 +30,7 @@ | |||
}, | |||
"dependencies": { | |||
"moment": "^2.8.4" |
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.
This is a syntax error. You need a comma.
ping @jdfreder , you're the one that know the most things about notebook test. Test seem to not run at all with this PR, but I can't seem to figure out the reason why, as the same step works flawlessly locally. Any ideas ? |
32131cd
to
831e7cd
Compare
1) finish the step allowing the use of es6 - this include some tweak to web pack configuration to speed up recompile in watch mode (in particular cache sourcemaps). - enable eslint (error only), on obvious mistakes. - setup babel to compile to es5 as a target. 2) Make the test pass under Casper that does not always have `Function.prototype.bind` defined, which we cannot patch only in the tests. 3) Write an actual shortcut editor that list and allow to modify most of the command mode shortcut. The logic to persist the shortcuts is a bit tricky as there are default keyboard shortcuts, and so when you "unbind" them you need to re-unbind them at next startup. This does not work for a few shortcut for technical reasons: `<Esc>`, `<Shift>`, as well as `<Ctrl-Shift-P>` and `<F>` which register asynchronously, so are not detected as "default" shortcuts.
a4ea097
to
12b4834
Compare
BTW, this now works, and can now use es6. |
What do you mean by "can use es6"? |
Sorry, was unclear, you can use es6 feature in all the js files (typically |
Ah - I didn't realize we were using babel. Are we still targeting ES5 runtimes? |
Yes. We can use something else than babel, I guess we can use a typescript loader as well, I have no issues with that. One thing I did not include is the ability to use |
I don't think we need to use the TS loader at this point. We've been doing okay just shipping the built |
Also, I think (but could be wrong) that preact has an |
Yes it has a |
Ok, merging to get people to complain. |
Replace #1265
Also introduce es6, and write the new keyboard shortcut editor as pure es6.
Does not use react.
[edit]
Update description after lots of refactor.
Create shortcut editor for the notebook
recompile in watch mode (in particular cache sourcemaps).
Make the test pass under Casper that does not always have
Function.prototype.bind
defined, which we cannot patch only in thetests.
Write an actual shortcut editor that list and allow to modify most of
the command mode shortcut.
The logic to persist the shortcuts is a bit tricky as there are default
keyboard shortcuts, and so when you "unbind" them you need to re-unbind
them at next startup. This does not work for a few shortcut for
technical reasons:
<Esc>
,<Shift>
, as well as<Ctrl-Shift-P>
and<F>
which register asynchronously, so are not detected as "default"
shortcuts.