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

example/with-typescript-plugin #3698

Merged
merged 7 commits into from
Feb 6, 2018
Merged

example/with-typescript-plugin #3698

merged 7 commits into from
Feb 6, 2018

Conversation

deptno
Copy link
Contributor

@deptno deptno commented Feb 6, 2018

@@ -0,0 +1 @@
*.js
Copy link
Contributor

@sergiodxa sergiodxa Feb 6, 2018

Choose a reason for hiding this comment

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

Not an expert of TS but do we still need to ignore .js files if we are using the webpack loader? I think we are now just using .tsx as a native file format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, Let me delete it

npm run dev
```

Output JS files are aside the related TypeScript ones.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed that line

@@ -0,0 +1,20 @@
{
"name": "with-typescript2",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can either remove the old example and use this or name it with-typescript-plugin, what do you think @timneutkens?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe maintain the old one for compatibility with old Next.js versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replace with-typescript2 -> with-typescript-plugin

"compilerOptions": {
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need to preserve JSX?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this option from https://github.com/zeit/next-plugins/tree/master/packages/next-typescript

I’ve tested styled-jsx with jsx option removal,
It works well, I removed from code

@sergiodxa
Copy link
Contributor

@deptno awesome (and super fast) work!

@deptno deptno changed the title example/with-typescript2 example/with-typescript-plugin Feb 6, 2018
@arunoda
Copy link
Contributor

arunoda commented Feb 6, 2018

I think we don't need to the keep the existing. I think this is a great improvement for the existing example and it's no longer will be needed.

@timneutkens your call.

@timneutkens
Copy link
Member

yeah please make this with-typescript the old example was a hack.

Copy link
Contributor Author

@deptno deptno left a comment

Choose a reason for hiding this comment

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

done

@sergiodxa sergiodxa merged commit 87ab61e into vercel:canary Feb 6, 2018
@kachkaev
Copy link
Contributor

Hi guys,

I just used your example to start a new project and noticed this error message from in VSCode:

[ts] Cannot use JSX unless the '--jsx' flag is provided.

After a bit of googling, I could solve this by adding "jsx": "preserve" to tsconfig.json and restarting the VSCode's TS server.

What made you remove this key from the config? Should we bring it back?

@timneutkens
Copy link
Member

@kachkaev the example should reflect: https://github.com/zeit/next-plugins/tree/master/packages/next-typescript#usage, feel free to create a pull request 🙏

@lock lock bot locked as resolved and limited conversation to collaborators Feb 18, 2019
TopDeveloper705 pushed a commit to TopDeveloper705/next.js-template-project that referenced this pull request Dec 11, 2022
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.

5 participants