-
Notifications
You must be signed in to change notification settings - Fork 685
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
RFC: Switch from createElement
to the default pragma
#21
Comments
From @zetlen on February 2, 2018 18:47 We overwrote the pragma because we thought we might have to monkeypatch |
From @DrewML on February 2, 2018 18:52
No, that wouldn't have anything to do with it. |
From @DrewML on February 2, 2018 18:53
I can't speak to that - I didn't set this up initially. |
From @jimbo on February 2, 2018 21:49 In the original concept, you (@zetlen) had indicated we might consider replacing React with another library, such as Preact. While I don't think Andrew or I ever supported that idea, it was on my mind when creating this repo that we might have to change every file with JSX at some point. Whichever pragma we use has to be imported by every file containing JSX. Whether it's The problem with That was the reasoning behind it, anyway. If we're sticking with React for good, it doesn't make much difference what pragma we use. I think comparing this to TypeScript is apples to oranges; this is minor, TS is major. |
From @DrewML on February 13, 2018 16:28
This would never be something we have to do, though. If Preact was used, we would have to use |
From @DrewML on February 13, 2018 16:32 Can we make a fake movie poster for |
I know this seems like a low priority, but the more code we make and the more contributors we have, the bigger and uglier a merge this will be downstream. I think we can say two things:
|
If someone outside our team wants to take it on, I'm all for it. 👍 |
Yeah I'd like to see it done (by community, of course) asap. Full instructions are in the op so should (hopefully) be an easy fix for someone. |
Hey, is there progress being made on this? If not I can give it a go. |
Yeah I haven't had a chance, go for it
…On Tue, Jul 31, 2018, 2:36 PM Paul ***@***.***> wrote:
Hey, is there progress being made on this? If not I can give it a go?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMLcEOC5zSIpURCwR2in8pAtNl64jzTuks5uMLHWgaJpZM4UnC_f>
.
|
Hey, I've made all the changes here. However, I had to edit the It'd definitely be better to just edit |
Updated my pwa-studio fork to use my fork of @magento-eslint here
|
Ok, I could use some help on this one. It seems that some of the tests fail because they can't find the FAIL packages/venia-concept/src/components/Gallery/__tests__/gallery.spec.js
● Test suite failed to run
ReferenceError: createElement is not defined
31 | regularPrice: shape({
32 | amount: shape({
> 33 | value: number.isRequired
| ^
34 | }).isRequired
35 | }).isRequired
36 | }).isRequired
at Object.<anonymous>.emptyData.map (src/components/Gallery/items.js:33:76)
at Array.map (<anonymous>)
at Object.<anonymous> (src/components/Gallery/items.js:33:32)
at Object.<anonymous> (src/components/Gallery/gallery.js:17:40)
at Object.<anonymous> (src/components/Gallery/__tests__/gallery.spec.js:13:16)
|
@pcvonz Took me way too long to get to this one. Thanks for volunteering and getting your hands dirty, man. I cloned your branch and discovered two things:
I put the fixes in a patch for you, so you can just apply it to your index with |
Rad! Patch applied and merged with master. I'll submit a pull request shortly. |
* Working router implementation using GraphQL API * First fully working iteration of Router integrated with API * Add docs for router * Fix misleading comment * Bug fix * Add test to validate we dont double-fetch components * Router >> using
From @DrewML on February 2, 2018 18:19
Edit: For those looking to contribute, the following changes need to be made:
createElement
import in each file (ex:import { Component, createElement } from 'react';
) toimport React from 'react';
orimport React, { Component } from 'react';
Peregrine
to make the same updatesPart of our reasoning for not using things like TS is that we didn't want to diverge too much from code people will see in examples.
Right now, we're over-writing Babel's pragma for
React.createElement
to justcreateElement
. This is going to be surprising for people copy/pasting code from tutorials.Proposing we go back to the default pragma.
Copied from original issue: magento-research/venia-pwa-concept#22
The text was updated successfully, but these errors were encountered: