Skip to content

Add React 16 to peerDependencies#173

Merged
auser merged 7 commits into
fullstackreact:masterfrom
sonaye:patch-1
Apr 7, 2018
Merged

Add React 16 to peerDependencies#173
auser merged 7 commits into
fullstackreact:masterfrom
sonaye:patch-1

Conversation

@sonaye

@sonaye sonaye commented Mar 30, 2018

Copy link
Copy Markdown
Contributor

I've been using this package with React 16 for a while on multiple projects, it works great. Not sure why it is still not officially supported though, this PR updates the peerDependencies.

@charanrajtc

Copy link
Copy Markdown

All components are not compatible with React 16 !

@sonaye

sonaye commented Apr 5, 2018

Copy link
Copy Markdown
Contributor Author

I am using all the components except for Polygon and Polyline, which components are you referring to?

@auser

auser commented Apr 6, 2018

Copy link
Copy Markdown
Contributor

Yeah, we’ll have to update the components.

Wanna take a stab at it @sonaye?

@sonaye

sonaye commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

I took a look at
https://github.com/fullstackreact/google-maps-react/blob/master/src/components/Polygon.js
https://github.com/fullstackreact/google-maps-react/blob/master/src/components/Polyline.js

Both look fine to me, unless I am missing something, so I am not sure about what needs to be done here to make things work.

Can you explain what's currently lacking @auser and perhaps point me in the right direction? I'll see what I can do.

@sonaye

sonaye commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

Note that I've been using the package with React 16 since it was released, never encountered an issue and I don't recall making any changes to the 15 code base to migrate it to 16.

@auser

auser commented Apr 6, 2018

Copy link
Copy Markdown
Contributor

It’s not that they are incompatible, it’s that the code currently used ‘createClass’ vs. classical style

@sonaye

sonaye commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

createClass exists only in the examples not the package itself, someone already updated the code. I’ll take care of the examples.

https://github.com/fullstackreact/google-maps-react/search?q=createClass

@sonaye

sonaye commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

Examples have been updated and tested. Also: I removed history from the package dependencies, moved to devDependencies. Finally, I added the dist folder to .gitignore, not sure why it is there, let me know if you want me to revert.

@sonaye

sonaye commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

The package in general needs some cleaning, there are tens of devDependencies that are really not needed (the whole process is very outdated), it's very dev unfriendly to be honest. If you are open to receiving another PR that take care of that please let me know.

@auser

auser commented Apr 6, 2018

Copy link
Copy Markdown
Contributor

@sonaye absolutely! Definitely open

@sonaye

sonaye commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

@auser Great, I'll work on it. I reverted removing the dist folder for now.

@sonaye

sonaye commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

@auser If you can take care of #172 and #178 (same feature) I probably can start working on this in the next hours (good timing for a 2.0.0 release). As for this PR, it's ready, let me know if something needs to be adjusted.

@auser

auser commented Apr 7, 2018

Copy link
Copy Markdown
Contributor

I just need to test it locally and I’m down to release a new version if all is good

@auser auser merged commit 6d4d442 into fullstackreact:master Apr 7, 2018
@auser

auser commented Apr 7, 2018

Copy link
Copy Markdown
Contributor

👍 AWESOME!

New version released!

@sonaye sonaye deleted the patch-1 branch April 7, 2018 13:05
@sonaye

sonaye commented Apr 7, 2018

Copy link
Copy Markdown
Contributor Author

I spent a couple of hours trying to refactor the project to make it more dev friendly and optimize it a little bit. I concluded that it's impossible for me to do that without introducing a couple of breaking changes (and possibly make different design decisions that don't match the ones currently implemented).

The code while it does the job and works just fine as a final product actually, is in a bad shape, to the extent that it would be easier for me just to start building everything from scratch instead of patching things up. It's best that we keep things as they are I think, as this has been working well for the past couple of years. Thanks for keeping this library maintained.

@sonaye

sonaye commented Apr 7, 2018

Copy link
Copy Markdown
Contributor Author

Things that I didn't understand:

  • the mechanism used to load the Google Maps script (ScriptCache.js), actually this is where I stopped.

Things to look into:

  • Why introduce a full dependency to the package (invariant) when you can just use simple if statements (this can help reduce the package size).
  • Support code splitting out of the box by not exporting all the components by default, or at least give the option to import each component by itself. Right now even if you don't use a certain component, let's say Polyline, chances are it is still bundled in the app code unless you do some tree shaking.
  • Code needs some format, it is difficult to read, maybe consider using Prettier.
  • Plenty of unused code is laying around, updating eslint rules to catch such snippets can help with this, I would extend it to use Airbnb rules.
  • No real need for Webpack, just run babel and you are good to go.
  • Tests are outdated, and I am not sure if they are really needed.
  • Remove dist from Github to avoid unnecessary large code diffs.

This isn't a critique in any way, just some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants