-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
farmOS-map 2.x Tracking Issue #115
Comments
TODO: Open Issue about browser compatibility in farmOS repo. |
|
@mstenta I've addressed all the points of feedback we came up with during today's dev call. Let me know if you think of anything else that should happen before these can be merged. |
Thanks @symbioquine ! LGTM! |
@paul121 @jgaehring and I had some really good discussion around this and some of the related/future work which I'll try to summarize here; Short term next steps;
Bigger Picture StuffFieldKit Integration of farmOS-map 2.x@jgaehring will experiment with this in the not-to-distant future. @symbioquine provided example of earlier prototype of change to do integration #68 (comment) (Some additional changes will make sense since the imports can be a bit cleaner now and it would probably make sense for FieldKit to use the NPM/Webpack integration instructions: https://github.com/farmOS/farmOS-map/tree/2.x#working-with-farmos-map-in-an-npmwebpack-project Upgrading from 1.x: https://github.com/farmOS/farmOS-map/tree/2.x#upgrading-from-farmos-map-1x-to-2x Cross-domain farmOS-map caching/versions and FieldKit hostingOne potential downside of bundling farmOS-map with FieldKit is that users will sometimes end up loading farmOS-map twice - once from FieldKit and once if they visit farmOS directly. If FieldKit were self-hosted it would allow the farmOS-map artifacts to be shared between FieldKit and the main farmOS pages. Also, as @paul121 points out, it could have helped avoid some of the major version upgrade challenges that have been present in moving users to farmOS 2.x at the It's also worth noting that it could be problematic if FieldKit and farmOS were running significantly different versions of farmOS-map since that might break behaviors if those were being loaded from the farmOS server. farmOS Hosted Client Modules in FieldKit@paul121 Walked @jgaehring and @symbioquine through the changes to support FieldKit loading "client modules" A.K.A "field modules" from a farmOS 2.x server. The changes are linked from https://www.drupal.org/project/farm/issues/3191246#comment-14124923 Basically, there's a controller which serves the contents of the module's single JS file at We discussed how this might violate developer's assumptions that they can declare dependencies for their client module JS using the normal @symbioquine suggested that an alternative strategy could be returning an HTML fragment to FieldKit in the same way Drupal/farmOS responds to normal AJAX requests. FieldKit would just append the response HTML fragment to its body - perhaps after some validation. In this way, the controller could use the more standard element rendering and JS/CSS attaching machinery in Drupal which would allow library dependencies and aggregation to work automatically out-of-the-box. farmOS Map Behaviors and FieldKitA large part of our discussion was around how farmOS-map behaviors should affect FieldKit. @symbioquine described why it seems pretty obvious that contrib modules in farmOS need to be loaded in FieldKit; Take for instance a farm/garden in a region that doesn't have good Google/MapBox base layers, it should be trivial for the same contrib module to supply custom base layers both for farmOS and FieldKit. Similarly, extending the drawing/geolocation/navigation/accessibility features of the farmOS map, should almost always also extend the map in FieldKit. We discussed various strategies for making that work - some of which @paul121 has already summarized in farmOS/farmOS#426 (comment) |
Are we ready to tag Or are there other "breaking changes" that we want to consider before that? Quick skim of open issues - @symbioquine @paul121 should any of these block |
I don't think these need to block 2.0. It seems like the concept of behavior settings could be implemented independent of farmOS-map as is. Later it could be included moved to farmOS-map if these patterns seemed useful in either farmOS-map core behaviors, or adding behaviors to farmOS-map in a decoupled context. |
Agreed! I think we can resolve this and tag v2.0.0 |
Great! One last thing we should consider... if we do move to using Currently we are running If we aren't using Asset Packagist anymore, we don't need to do this. So we can probably rearrange the action steps such that it publishes to NPM before running Line 1 in 9423f71
|
I think we should still include the built artifacts in the
|
Oh ok! If that's a common convention, then we can keep that. Sounds good to me. @symbioquine do you want to do the honors of releasing |
Sure :) |
Actually, @paul121 I just noticed that the built JS/CSS chunks aren't being included... We'll probably need to fix that and tag a v2.0.1 release :( |
The v2.0.1 release includes #130 and I've confirmed that the release zip looks like it has all the expected files now. |
I'm going to use this issue to track the sequence of pull requests that will make up the initial farmOS-map 2.x changes.
Introduction
Why Do We Need a farmOS-map 2.x?
There are a few breaking changes which are needed to allow farmOS-map's functionality and contrib ecosystem to keep growing without a correspondingly growing performance footprint.
What do these changes do?
This allows their code to be lazy loaded at runtime.
farmOS.map.behaviors
Now all "default" behaviors are loaded from
farmOS.map.behaviors
when an instance is created.farmOS.map.namedBehaviors
Now the available behaviors which can be attached via
instance.addBehavior
can be modified/extended instead of just being hard-coded to [rememberLayer
,edit
,measure
,snappingGrid
]. This functions as a registry where behaviors can be registered without necessarily having them be loaded on instance creation. That opens up exciting possibilities for patterns where one contrib module can expose a behavior that is leveraged by other behaviors.This allows the included behaviors in farmOS-map to keep growing, but not incur a performance penalty unless those behaviors are actually used on/in a given page/app.
farmOS-map.css
which must be included in any page using farmOS-map. Lazy loaded functionality automatically includes any additional css as needed.This allows pages/apps to directly manage how they consume
farmOS-map.css
- possibly applying their own minification/aggregation/customization.Pull Requests
1.x Baseline
2.x
farmOS.map.namedBehaviors
.MapInstanceManager
fromwindow.farmOS.map
as described in farmOS-map packaging and module exports #113.MapInstanceManager
and the default projection settings atwindow.farmOS.map
Update farm_map_google behavior contrib module for farmOS-map 2.x paul121/farm_map_google#1 - Update the farm_map_google package for 2.xRelease updated farm_map_google contrib module - See https://github.com/symbioquine/farm_map_google & https://www.drupal.org/project/farm_map_googleLayerGroup
instances.@mstenta@symbioquine needs to push the above change up to the NPM package as a new version .e.g.1.7.1
Note: Many of the above changes are the same ones I previously published in #109, but I'm going to republish them now as separate pull requests using this issue to coordinate/track the review/merge process.
The text was updated successfully, but these errors were encountered: