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

Add TypeScript support and demo small refactor #1792

Merged
merged 3 commits into from
Dec 20, 2019
Merged

Conversation

dmsnell
Copy link
Member

@dmsnell dmsnell commented Dec 19, 2019

As if the types and data flows weren't complicated enough in this
application, we have no support from the language or compiler to make
sense of it all.

In this patch we're adding TypeScript into the build pipeline to allow
for writing modules in TypeScript and to aid us in knowing just what we
are dealing with.

Types are stripped from the modules before sending to Babel and so
therefore we won't prevent a build just because there are type errors.

This patch enables a certain level of autocomplete on appState,
indicating which action creators are available.

Testing

Build the app and smoke-test it. I refactored some state code so basic
operations like loading notes should fail if anything is wrong.

autocomplete mov

As if the types and data flows weren't complicated enough in this
application, we have no support from the language or compiler to make
sense of it all.

In this patch we're adding TypeScript into the build pipeline to allow
for writing modules in TypeScript and to aid us in knowing just what we
are dealing with.

Types are stripped from the modules before sending to Babel and so
therefore we won't prevent a build just because there are type errors.

This patch enables a certain level of autocomplete on `appState`,
indicating which action creators are available.
@dmsnell dmsnell requested a review from a team December 19, 2019 00:36
Copy link
Contributor

@belcherj belcherj left a comment

Choose a reason for hiding this comment

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

This is great! Let's get this merged and continue to iterate.

@dmsnell dmsnell merged commit cef553b into develop Dec 20, 2019
@dmsnell dmsnell deleted the add/typescript branch December 20, 2019 00:44
dmsnell added a commit that referenced this pull request Jan 7, 2020
In #1792 I introduced a typo from `name` to `namer` and this prevented the tag
drawer from working properly. That is, when trying to filter by tag it was
looking for matches on `tag.data.namer` instead of on `tag.data.name` and
unsuprisingly there were no matches.

After this patch things are restored to normal working order.
dmsnell added a commit that referenced this pull request Jan 7, 2020
In #1792 I introduced a typo from `name` to `namer` and this prevented the tag
drawer from working properly. That is, when trying to filter by tag it was
looking for matches on `tag.data.namer` instead of on `tag.data.name` and
unsuprisingly there were no matches.

After this patch things are restored to normal working order.
dmsnell added a commit that referenced this pull request Jan 16, 2020
In paFIJd-8t it was reported that note corruption was occurring when viewing the history of one note when it gets updated remotely. Although this fix may or may not address that problem a code audit revealed that in #1792 I removed what appeared to be an unused function when it was in fact used by the component's `onClickOutside` wrapper.

The missing handler function closed out of the revision slider when clicking anywhere else. Without it, the thread handling the click crashed but since it was a callback it didn't crash the app. A message appeared in the developer console indicating that the handler was missing.

Because we haven't been closing the revision slider it has become possible to start editing a note while the revisions are still open, something prevented before by way of the click handler. Thus, if viewing a revision, clicking anywhere else, and continuing, then we fill the editor with what it thinks is a note (and not a revision) and then will respond to remote updates with the contents of that revision before accepting remote updates.
dmsnell added a commit that referenced this pull request Jan 17, 2020
In paFIJd-8t it was reported that note corruption was occurring when viewing the history of one note when it gets updated remotely. Although this fix may or may not address that problem a code audit revealed that in #1792 I removed what appeared to be an unused function when it was in fact used by the component's `onClickOutside` wrapper.

The missing handler function closed out of the revision slider when clicking anywhere else. Without it, the thread handling the click crashed but since it was a callback it didn't crash the app. A message appeared in the developer console indicating that the handler was missing.

Because we haven't been closing the revision slider it has become possible to start editing a note while the revisions are still open, something prevented before by way of the click handler. Thus, if viewing a revision, clicking anywhere else, and continuing, then we fill the editor with what it thinks is a note (and not a revision) and then will respond to remote updates with the contents of that revision before accepting remote updates.
dmsnell added a commit that referenced this pull request Jan 21, 2020
In paFIJd-8t it was reported that note corruption was occurring when viewing the history of one note when it gets updated remotely. Although this fix may or may not address that problem a code audit revealed that in #1792 I removed what appeared to be an unused function when it was in fact used by the component's `onClickOutside` wrapper.

The missing handler function closed out of the revision slider when clicking anywhere else. Without it, the thread handling the click crashed but since it was a callback it didn't crash the app. A message appeared in the developer console indicating that the handler was missing.

Because we haven't been closing the revision slider it has become possible to start editing a note while the revisions are still open, something prevented before by way of the click handler. Thus, if viewing a revision, clicking anywhere else, and continuing, then we fill the editor with what it thinks is a note (and not a revision) and then will respond to remote updates with the contents of that revision before accepting remote updates.
dmsnell added a commit that referenced this pull request Jan 21, 2020
In paFIJd-8t it was reported that note corruption was occurring when viewing the history of one note when it gets updated remotely. Although this fix may or may not address that problem a code audit revealed that in #1792 I removed what appeared to be an unused function when it was in fact used by the component's `onClickOutside` wrapper.

The missing handler function closed out of the revision slider when clicking anywhere else. Without it, the thread handling the click crashed but since it was a callback it didn't crash the app. A message appeared in the developer console indicating that the handler was missing.

Because we haven't been closing the revision slider it has become possible to start editing a note while the revisions are still open, something prevented before by way of the click handler. Thus, if viewing a revision, clicking anywhere else, and continuing, then we fill the editor with what it thinks is a note (and not a revision) and then will respond to remote updates with the contents of that revision before accepting remote updates.

(cherry picked from commit 43bc2a5)
dmsnell added a commit that referenced this pull request Jan 21, 2020
In paFIJd-8t it was reported that note corruption was occurring when viewing the history of one note when it gets updated remotely. Although this fix may or may not address that problem a code audit revealed that in #1792 I removed what appeared to be an unused function when it was in fact used by the component's `onClickOutside` wrapper.

The missing handler function closed out of the revision slider when clicking anywhere else. Without it, the thread handling the click crashed but since it was a callback it didn't crash the app. A message appeared in the developer console indicating that the handler was missing.

Because we haven't been closing the revision slider it has become possible to start editing a note while the revisions are still open, something prevented before by way of the click handler. Thus, if viewing a revision, clicking anywhere else, and continuing, then we fill the editor with what it thinks is a note (and not a revision) and then will respond to remote updates with the contents of that revision before accepting remote updates.

(cherry picked from commit 43bc2a5)
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