This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 392
lazy load CustomEvent
to fix snapshotting
#1384
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
annthurium
pushed a commit
to atom/atom
that referenced
this pull request
Apr 11, 2018
Fixed snapshotting issue in atom/github#1384
kuychaco
reviewed
Apr 11, 2018
@@ -78,7 +83,7 @@ export default class CommitView extends React.Component { | |||
return; | |||
} | |||
|
|||
const fakeEvent = new FakeKeyDownEvent(keyCode); | |||
const fakeEvent = getFakeKeyDownEvent(keyCode); |
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.
Sweet, thanks for fixing the broken snapshotting @annthurium! ✨
One minor suggestion with efficiency in mind - with this approach we are creating a new class FakeKeyDownEvent
every time proxyKeyCode
gets called.
We can do this just once if we do something like this:
have a global variable:
let FakeKeyDownEvent;
and in proxyKeyCode
check to see if it exists, creating it if it doesn't:
if (!FakeKeyDownEvent) {
FakeKeyDownEvent = class FakeKeyDownEvent extends CustomEvent {
constructor(kCode) {
super('keydown');
this.keyCode = kCode;
}
}
}
const fakeEvent = new FakeKeyDownEvent(keyCode);
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.
good suggestion! Will fix.
dolsenj
added a commit
to dolsenj/atom
that referenced
this pull request
Apr 20, 2018
…seful when the tab length of a file differs from the default tab language for a programming language. Fixed lint errors. Added spec tests to workspace-spec because there are currently no tests for the tab length detection change. The JavaScript sample files are test inputs for tab length detection. Only changes the tab length when detected tab length differs from current tab length because this change was reverted. Reverting back to commit because future commits caused build errors. :arrow_up: tree-sitter and language packages :arrow_up: text-buffer Address review feedback Add exemptLabels to the configuration Limit the bot to issues only Capitalize Safe Mode Revert ":arrow_up: text-buffer" This reverts commit 553dec3. :arrow_up: line-ending-selector :arrow_up: text-buffer Take 2 Special-casing \r breaks the word regexp :arrow_up: find-and-replace Remove duplicate command bindings for undo and redo Co-authored-by: Nathan Sobo <nathan@github.com> Remove JSX Defer loading of PaneContainerElement to fix snapshotting :arrow_up: fuzzy-finder@1.8.1 @smashwilson's updates Add Teletype highlights from the past week and focus for the coming week Defer component initialization until element is requested This fixes the error snapshotting Docks described in atom#16864. :arrow_up: tree-view@0.223.0 Revert ":arrow_up: tree-view@0.223.0" This reverts commit 139b3c6. :arrow_up: one-dark/light-ui@v1.12.0 :memo: Document deprecation for `undo` option Refs atom#16956 ⬆️ text-buffer@13.14.0 ⬆️ tree-sitter Weekly focus document template @smashwilson's update for last week. More sparse than I like to see 😞 add @annthurium's contributions from last wek Fix markdown formatting Fix link Add Teletype highlights from the past week Add reactor duty highlights from the past week Add @daviwil focus for the week Add Max's focus Add Xray things :arrow_up: autocomplete-plus@2.40.6 :arrow_up: find-and-replace@0.215.8 :arrow_up: tree-sitter :arrow_up: one-dark/light-ui@v1.12.1 :arrow_up: find-and-replace Bump github package version to 0.13.0 bump atom/github to 0.13.2 Fixed snapshotting issue in atom/github#1384 ⬆️ spell-check@0.73.2 ⬆️ snippets@1.3.2 ⬆️ styleguide@v0.49.11 ⬆️ text-buffer ⬆️ github ⬆️ spell-check@0.73.3 ⬆️ language-python ⬆️ grammar-selector@0.50.1 Separate TextEditor keyboard enablement from readOnly state Derive the `readonly` attribute from `model.isReadOnly()` Return the property we're actually setting Can't use the same name for the property and method Boolean logic, my old enemy Increment the version of the readOnly serialization key 👕 restore missing break Adding additional operating systems to travis.yml because there are issues when multiple operating systems are used. Changes the tab length only when it is different from the current tab length because it is redundant to set the tab length to itself. Fixed lint errors.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: When I went to prepare the
0.13.0
release, snapshotting failed with the following output:CustomEvent
is a DOM primitive that is not available in the v8 context. Solution is to make the code that needsCustomEvent
not execute while snapshotting.Test plan:
atom/github
esc
key, which uses theFakeKeyDown
functionality.atom/github
, and then builtatom/atom
locally with my pre release version. Build output successfully executed snapshotting.