codi.link icon indicating copy to clipboard operation
codi.link copied to clipboard

JSX support

Open Joandres-Lara opened this issue 4 years ago • 4 comments

When using JSX syntax is not work, but if using without, example React.createElement("div", null, "Hello"), working.

image

https://codi.link/PCFET0NUWVBFIGh0bWw+DQo8aHRtbCBsYW5nPSJlbiI+DQo8aGVhZD4NCiAgICA8bWV0YSBjaGFyc2V0PSJVVEYtOCI+DQogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0iPg0KICAgIDx0aXRsZT5Eb2N1bWVudDwvdGl0bGU+DQo8L2hlYWQ+DQo8Ym9keT4NCiA8ZGl2IGlkPSJhcHAiPjwvZGl2Pg0KPC9ib2R5Pg0KPC9odG1sPg==||aW1wb3J0IHsgcmVuZGVyIH0gZnJvbSAnaHR0cHM6Ly9jZG4uc2t5cGFjay5kZXYvcmVhY3QtZG9tJzsKaW1wb3J0IFJlYWN0IGZyb20gJ2h0dHBzOi8vY2RuLnNreXBhY2suZGV2L3JlYWN0JzsKCnJlbmRlcihSZWFjdC5jcmVhdGVFbGVtZW50KCJoMSIsIG51bGwsICJIZWxsbyIpLCBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiYXBwIikpCi8vcmVuZGVyKDxoMT5IZWxsbzwvaDE+LCBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiYXBwIikpCg==

Joandres-Lara avatar Oct 01 '21 15:10 Joandres-Lara

First of all, i think we need to have like a list of all the packages and look into it if it's React (only this for now), and if it is, then add the needed behavior to support the jsx. I will open an issue for the packages list, because the application also lets you import the same packages anytimes you want, so it's better to deal with it as a separated problem

EDITED: There's already a PR for that so no needed to open the issue xd

bkerz avatar Oct 03 '21 17:10 bkerz

Which, PR? Well, what ever, the label correct is feature, just is suggest, I know this is advanced topic.

Joandres-Lara avatar Oct 04 '21 13:10 Joandres-Lara

First of all, i think we need to have like a list of all the packages and look into it if it's React (only this for now), and if it is, then add the needed behavior to support the jsx. I will open an issue for the packages list, because the application also lets you import the same packages anytimes you want, so it's better to deal with it as a separated problem

EDITED: There's already a PR for that so no needed to open the issue xd

Nah, that's too complex. Just add an option to change from .js to .jsx and from .jsx to .js. This would install react and react-dom.

ghost avatar Oct 08 '21 15:10 ghost

@dragonDScript Ammm, but should be install babel/preset-react, and compile file, this in real time, is more complex.

Edit: May be, using esbuild.

Joandres-Lara avatar Oct 08 '21 15:10 Joandres-Lara