Skip to content
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

Port ui/editor to snabbdom and TypeScript #5655

Merged
merged 12 commits into from
Nov 19, 2019
Merged

Port ui/editor to snabbdom and TypeScript #5655

merged 12 commits into from
Nov 19, 2019

Conversation

niklasf
Copy link
Member

@niklasf niklasf commented Nov 17, 2019

No description provided.

@ornicar
Copy link
Collaborator

ornicar commented Nov 19, 2019

Awesome. Is that ready?

@@ -21,7 +21,7 @@ object editor {
moreJs = frag(
jsAt(s"compiled/lichess.editor${isProd ?? (".min")}.js"),
embedJsUnsafe(s"""var data=${safeJsonValue(bits.jsData(sit, fen, animationDuration))};data.positions=$positionsJson;
LichessEditor(document.getElementById('board-editor'), data);""")
LichessEditor.default(document.querySelector('#board-editor > .board-editor'), data);""")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like snabbdom replaces the element instead of replacing its content. I wonder if there is a more elegant way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in the other modules I just recreate the main#board-editor root with snabbdom.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit awkward, because the editor can also be embedded in the study chapter dialog.

@niklasf
Copy link
Member Author

niklasf commented Nov 19, 2019

I think so, yes.

Edit: In it's current form, requires full deploy, because of the issue above.

@ornicar ornicar merged commit ab06396 into lichess-org:master Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants