Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

JSX Transform #51

Closed
miljan-aleksic opened this issue Jan 17, 2017 · 12 comments
Closed

JSX Transform #51

miljan-aleksic opened this issue Jan 17, 2017 · 12 comments

Comments

@miljan-aleksic
Copy link

Thank you @znck, this plugin is very much needed!

After the error ReferenceError: React is not defined and LOL I can confirm the plugin doesn't support JSX transformation and somehow uses the React one. I can even see in yarn.lock the react references, although is not a direct dependency.

I am not sure about the solution, relatively new to Rollup and bundlers plugins, but would like to help in any matter possible, so let me know!

@znck
Copy link
Member

znck commented Jan 17, 2017

Can provide your rollup config file and the file (or part ) that is causing the error?

@miljan-aleksic
Copy link
Author

It's a migration in progress, so please ignore all the noise - Rollup config, JSX example.

@miljan-aleksic
Copy link
Author

I have converted the JSX code into pure functions and the react issue is gone, but some still persist.

[Vue warn]: Error when rendering component <transition>: 
[Vue warn]: Unknown custom element: <tabcontent>

Transition is a global component and tabcontent (functional) is locally declared.

@znck znck added the bug label Jan 17, 2017
@znck
Copy link
Member

znck commented Jan 18, 2017

rollup-plugin-vue works with .vue files only. For JSx there is babel-plugin-transform-vue-jsx.

@znck znck removed the bug label Jan 18, 2017
@miljan-aleksic
Copy link
Author

I know, I'm talking about .vue files with JSX code inside, which is converted to js with babel-plugin-transform-vue-jsx. Anyway, even without JSX code, seems failing with functional components.

Did you tried those?

@znck
Copy link
Member

znck commented Jan 18, 2017

I haven't. I'm trying now.

@posva
Copy link
Member

posva commented Jan 18, 2017

@miljan-aleksic
Copy link
Author

@posva, interesting. How is that for Webpack Evan has created a Vue specific plugin but for Rollup this generic one is enough?

@posva
Copy link
Member

posva commented Jan 18, 2017

@miljan-aleksic You may miss some very specific features: https://github.com/vuejs/babel-plugin-transform-vue-jsx#jsx-spread. But using babel instead of buble is perfectly fine

@miljan-aleksic
Copy link
Author

ok, thanks :)

@znck
Copy link
Member

znck commented Jan 18, 2017

Check out this example repository. It got it working.

@znck znck closed this as completed Jan 18, 2017
@miljan-aleksic
Copy link
Author

I am currently refactoring the library and when finish will get pack to the build. You are both awesome, thank you guys!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants