[core] Switch to Typescript incrementally (tests run @babel/register)#9561
[core] Switch to Typescript incrementally (tests run @babel/register)#9561rosskevin wants to merge 95 commits into
Conversation
|
@agamrafaeli you wrote the tests in Here are the specifics: In menu.spec - describe('menuList.selectedItem exists', () => {
before(() => {
instance.menuList = {};
instance.menuList.selectedItem = SELECTED_ITEM_KEY;
});yielding this error which seems appropriate AFAIK (also see circleci logs): Invariant Violation: Element appears to be neither ReactComponent nor DOMNode. Keys: selectedItem
at invariant (node_modules/fbjs/lib/invariant.js:42:15)
at Object.findDOMNode (node_modules/react-dom/cjs/react-dom.development.js:15282:7)
at Menu.value [as handleEnter] (src/Menu/Menu.js:72:31)Any help is appreciated @agamrafaeli |
|
@rosskevin stubbing ReactDOM.findDOMNode doesn't seem to be working, but you can try stuffing a nodeType into You should be able to do this in the rest of the tests like this. |
|
@kgregory this worked for several, but not all. I figured out that |
|
Filed babel/babel#7088 related to the issues we are seeing with stubbing in This can be fixed other ways if someone is interested in contributing. |
|
Theoretically @oliviertassinari typescript support has been added to next.js vercel/next.js#3578 (comment) |
|
@rosskevin I'm happy they switched to using webpack for the server. It will solve a bunch of problem in my app with Next.js. |
|
@rosskevin I'm closing. I fear this pull-request is already quite behind HEAD. I don't think it was a waste of time. I believe we have now a better understanding of the implications of using TypeScript. So thanks! I think that we gonna have to start by upgrading 1. Babel and 2. Next.js. |
Variation on #9535. This uses no typescript runtime of any kind -it is all
babel- just as we use on the currentv1-beta(except babel 7.x).What must be fixed
build:es- failing again - not ignoring*.d.ts(cannot have these in.babelrc) and cli ignore wasn't catching themyarn test:unit- 11 broken tests - many related torefandfindDOMNode- perhaps due to babel 7 updateWhat can wait but should be fixed eventually
transform-dev-warning- not updated to babel 7Unable to process function body node type: ArrowFunctionExpression- possibly istanbul/babel 7 - not sure if this could cause other problemsCompleted
yarn build runs- updated to babel 7.Effectively, we use
tsclike we didflow, andtscis uninvolved in the build/runtime process.