-
Notifications
You must be signed in to change notification settings - Fork 115
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
v1.10 and v2 umbrella #110
Comments
Want help with any of this? |
@tstirrat15 Feel free to take a stab at any of the last three - Strict mode tests, docs, hooks. I'm a bit short on time, but let me know if you want to start on one, and I'll write up some thoughts I have on that particular item. |
Strict mode tests sounds the most immediately tractable. Is that pretty straightforward? |
Yes it should be. The idea would be to wrap all tests in I don't see any actual assertions around Strict mode, but I guess it would be easily verifiable in the Travis runs as soon as something is violating strict mode. Does that all make sense? |
Yep. What I've seen in using it in our own project is that it throws warnings at runtime. Is Travis configured to treat warnings as failures? Otherwise it'd probably entail manual review of the test output. |
Yeah I think manual review is fine. I usually run the tests before publishing, but more importantly, when users start complaining that something is not compliant with strict mode, we would be able to verify it quickly by running the tests. |
Do you want/need any help with the docs? Did you have an idea for a direction on that? |
I already started on a cleanup of the docs on master. The general idea would be to merge But I guess you could already perform the merge, and write up some docs on Thanks again for the help man! |
I'll write a doc block for |
Would it possible to get an RC or alpha build released on npm for the I'd really like to see if the 2 pass renderer solves some issues I'm seeing in a project. Thanks |
@South-Paw Yeah, that would be possible. Only gotcha is that the next branch has a big breaking change, we replaced the Would it still be useful for you to test out the |
Yeap I think it'd be fine to test it out even with those changes. It won't be to hard to go through and migrate |
@South-Paw No, the <Media queries={{
sm: "(max-width: 1000px)",
lg: "(max-width: 2000px)"
}}>
{(matches) =>
<>
{ matches.sm && <span>I'm small</span>}
{ matches.lg && <span>I'm large</span>}
</>
}
</Media> |
Okay, that looks good - liking that pattern as well 👍 If it's possible to do a alpha/RC release that'd be awesome - I'll give it a try out and see how it goes |
@South-Paw Hey I just prepared everything for an alpha release, but sadly the deploy process halted due to an invalid npm token. I don't have access to the npm project, so we'll have to wait for @mjackson to fix the token in Travis. See #120 for details. |
Same here.
Server/client mismatch breaks the site layout when it's loaded on mobile using react-static ssr.
I'm also very keen on testing this.
…---- Alex Gabites wrote ----
Hi, its been 2 weeks and @mjackson hasn't responded to #120 - has there been any movement on this?
Still pretty keen to try test this 👍
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/ReactTraining/react-media","title":"ReactTraining/react-media","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #110: Hi, its been 2 weeks and @mjackson hasn't responded to #120 - has there been any movement on this?\r\n\r\nStill pretty keen to try test this 👍"}],"action":{"name":"View Issue","url":"#110 (comment)"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#110 (comment)", "url": "#110 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
|
Hey guys, I'm really sorry about the delay. I've dm'd @mjackson, but I imagine his inboxes must be bursting 😅. In the meantime, would it be an option for you guys to test the
Now run your project as usual, it should use your local copy of |
Thank you! |
During build I get the following error:
|
@baumzeit Huh, I did the following, and was able to successfully build the project:
Did you do something similar? |
Yes, I can confirm:
throws the above error. Here is the complete trace: Error: Module not found: Error: Can't resolve './Media.js' in '/'
[... npm error messages] |
@baumzeit Damn, you think this could be a windows issue? I don't have a windows environment at hand to test :\ In any case, when the build get's fixed you should be able to test the alpha release. Sorry again for the wait |
@edorivai It looks like it's a windows issue.
|
I've gotten really frustrated waiting for a month and a half when I really need to test and/or fix the SSR issue a few Gatsby websites now... I'm going through building and publishing my own version of Problem seems to be in the
Can't tell if its required or not, but removing the plugin from the |
Scratch that, doesn't seem my republished version works either.
How long until the npm token gets fixed @edorivai? I've pinged @mjackson twice on twitter and I doubt he's seen either... but its getting really frustrating that it's been a month and a half with no movement on the issue. |
@South-Paw Hey man, I understand that you're frustrated. I've pinged @mjackson on twitter, as well as email, so there isn't too much I can do anymore. I've also considered publishing under a different npm package, but honestly didn't get the time to do so yet. One quick remark on the error you're running into. When I build on my system (I'm running Linux), there's only a single file inside the |
@edorivai Sorry, I know its not your fault and @mjackson is obviously a busy person as well - just annoying to have a ~70k dl/w package, that works really really well and has a good 2.0 update coming to be hamstrung by a such a trivial issue 😥 I've been out tonight so no code time, but I'll run another build tomorrow and take a screenshot. Thanks for the continued replies 👍 |
Hi @edorivai - we needed a hooks port so we created one, here: react-media-hooks. I don't plan to publish to npm as this would likely be in conflict with your 2.0 plans. Also, we would need to add more tests, TS support, etc., but this private version works for us. Thanks! |
@moflo Thanks 😄. We're planning to add hooks as well, but we first want to get v2 published. @South-Paw @baumzeit Good news, the deployment problems have been fixed 🎉. You should be able to install |
@edorivai awesome, thanks 👍 |
@edorivai gave While I don't think I've got a specific Gatsby issue, I do think its to do with how Gatsby statically creates the website for build/publish and how it interacts with Unsure what steps I can take next on this 🤔 so any suggestions are welcome |
@South-Paw If you have the time, it would be incredibly helpful if you could post a minimal reproduction repository that I can try out for myself. One thing I can add though, I took a look with @baumzeit at the problems he was having, and he was using react-static. This was before the two-pass render was published to npm, so we quickly implemented the two-pass render in his own codebase. And that did seem to solve his problem (inconsistent DOM after rehydration). |
@baumzeit If you have time, would you be so kind to test |
Does that mean that |
It does, so yes, please try it out😊 |
@edorivai I had to write a component that could listen on multiple, device-specific media queries, so I went ahead and used this alpha. It's working great in our uses of a single query and our new use of multiple queries. The one downside is that now the typescript defs are out-of-date. I tried my hardest to write a type that would tie the keys from the |
@joefiorini Thanks for letting me know! I'll have to take a look at the TS definitions |
What's the status of 2.0 and hooks support? |
I can put through a PR for the hook update. |
For any one interested : hooks are available in 2.X branch, with Big big thx to @tstirrat15 and @edorivai for this ! ❤️ |
I just tested react-media@next with my gatsby website and I can confirm that the two-pass rendering does not seem to work anymore. My media query is set to render the content for mobile in the SSR and when I open the website on desktop it does not change but stays on the mobile version. I had to revert back to the 1.10.0 to make everything work as intended again. |
@JonasJuss can you give me an example of how it's supposed to work and how it fails? I'll admit that I don't understand two-pass rendering well enough, and it hasn't yet been captured in a test. I'd like to write one. |
Update (March 17th, 2019)
As described in detail in #123, I'm seriously considering publishing the current changes under a minor version bump:
1.10
. The bulk of the preparations for this have already been done in #123.The next step would be to implement a v2 which uses hooks for the core functionality. I expect a hooks implementation could simplify some of the internals, and would simultaneously allow us to ship a hook as part of the API.
2.01.10query
prop toqueries
(Change query to queries #72)componentDidMount
(solves Two-pass render on the client #81, Is this SSR ready out of the box? #91, React strict mode #109, PR: Implement two-pass render (closes #81) #96)<Strict>
mode (Wrap all tests in <Strictmode> #115)queries
#119)2.12.0 (now available asreact-media@next
)implement a hooks API, exposed asreact-media/hooks
useMedia
hook<Media>
component, which is compatible with v1.10, but uses said hook internallyI propose exposing
Media
as the default export and exporting the hook as a named export:This would allow people to seamlessly upgrade to v2, without having to change existing code. There's also not really any use in splitting things up, since the Media component will be very small (just a wrapper around the hook), and it will use the hook under the hood. So I don't expect us splitting up the files will result in significant bundle size savings.
The text was updated successfully, but these errors were encountered: