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

move records into core #2563

Merged
merged 1 commit into from Feb 21, 2018
Merged

move records into core #2563

merged 1 commit into from Feb 21, 2018

Conversation

rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Feb 21, 2018

Closes #2408, moving core records into @nteract/core and out of @nteract/types.

Necessary follow up PRs:

  • Correct type inside of selectors.
  • Address the keypath $FlowFixMes

There will be some duplication in the middle of this, followed by a magical rebase that makes it look like I did it all in one ✨

@rgbkrk rgbkrk force-pushed the migrate-records branch 2 times, most recently from 2f3ed35 to 2768c64 Compare February 21, 2018 17:04
@rgbkrk
Copy link
Member Author

rgbkrk commented Feb 21, 2018

Rebased this against master, still more to go.

@rgbkrk rgbkrk force-pushed the migrate-records branch 2 times, most recently from b152f9b to beb6055 Compare February 21, 2018 17:25
@rgbkrk
Copy link
Member Author

rgbkrk commented Feb 21, 2018

This will definitely be rebased...

@rgbkrk rgbkrk mentioned this pull request Feb 21, 2018
@rgbkrk
Copy link
Member Author

rgbkrk commented Feb 21, 2018

Stopping this one without doing selectors. I'll do a separate PR for that ball of wax.

@rgbkrk rgbkrk changed the title [wip] movement of records move records into core Feb 21, 2018
@@ -4,7 +4,7 @@ import { remote } from "electron";
import { from } from "rxjs/observable/from";

import * as nativeWindow from "../../src/notebook/native-window";
import { makeAppRecord, makeDocumentRecord } from "@nteract/types/core/records";
import { makeAppRecord, makeDocumentRecord } from "@nteract/core/records";
Copy link
Member Author

Choose a reason for hiding this comment

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

As you'll see in most of this PR, it was a lot of turning @nteract/types/core/records into @nteract/core/records

Copy link
Contributor

Choose a reason for hiding this comment

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

I've added @nteract/core/types, do you think we should keep /records in that? We're starting to duplicate work as you mentioned, we should make sure we have a plan to resolve the duplication in the future. Thoughts?

@@ -39,7 +39,9 @@ import * as jmp from "jmp";

import type { NewKernelAction } from "@nteract/core/actionTypes";

import type { KernelInfo, LocalKernelProps } from "@nteract/types/core/records";
import type { KernelInfo, LocalKernelProps } from "@nteract/core/src/records";
Copy link
Member Author

Choose a reason for hiding this comment

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

Since the top level packages/core/records doesn't re-export the types, we pull these out of src.

@@ -26,8 +26,8 @@ import {
makeAppRecord,
makeDesktopHostRecord,
makeDocumentRecord,
CommsRecord
} from "@nteract/types/core/records";
makeCommsRecord
Copy link
Member Author

Choose a reason for hiding this comment

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

Wise change I probably could have done in another PR. It was confusing me as to if this was a type or something else, when it was another record creator.

@@ -269,6 +269,7 @@ export function exportPDF(
notificationSystem: *
): void {
const state = store.getState();
// $FlowFixMe: This should be using a selector first and foremost
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll fix this in a follow up PR when I do the selector bits.

KernelspecsRef,
KernelspecProps
} from "@nteract/types/core/records";
import type { KernelspecsRef, KernelspecProps } from "./records";
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll merge this into a later import in this file.

@@ -142,7 +150,7 @@ export type NotebookMetadata = {
// orig_nbformat?: number,
};

export type Notebook = {
export type NotebookRecordProps = {
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: This type isn't used at all here.

@@ -168,7 +176,7 @@ export const makeAppRecord: RecordFactory<AppRecordProps> = Record({
host: null,
githubToken: null,
notificationSystem: {
addNotification: msg => {
addNotification: (msg: { level?: "error" | "warning" }) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Did this just to increase coverage.

notebook: ?Notebook,
// TODO: This _needs_ to become a Record
notebook: ?Map<string, any>,
savedNotebook: ?Map<string, any>,
Copy link
Member Author

Choose a reason for hiding this comment

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

We were missing this property on the document record.

...except for in selectors
@theengineear theengineear merged commit 02c54ce into nteract:master Feb 21, 2018
@rgbkrk rgbkrk deleted the migrate-records branch February 21, 2018 20:49
@rgbkrk rgbkrk added this to the Jupyter Extension M1 milestone Feb 22, 2018
@rgbkrk rgbkrk mentioned this pull request Mar 7, 2018
7 tasks
@lock
Copy link

lock bot commented May 1, 2018

Howdy! I'm 🔓🤖!

In order to keep information timely (based on the most recent release), we want all activity to be added to either new issues or open issues and PRs. In service to that goal, I, the lock bot close inactive closed issues when they haven't had activity in 120 days.

Feel free to open a new issue for related bugs and link to relevant comments from this thread.

@lock lock bot locked and limited conversation to collaborators May 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants