-
Notifications
You must be signed in to change notification settings - Fork 28
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
Refactor for library / interface split #329
Conversation
const reassignment on line 920 `col = field.getColumn(this, col);` was causing my application to fail to load.
I'll try to have a peek/runthrough tomorrow, and then follow up with questions. |
I checked it out and also consulted with the team and happy to see its 98% there! It seems like on my local test of web/dist/index.html, as well as the localhost http://localhost:8080/ yarn version:
I could find time this week to try to resolve those things. No other dev. planned for this week. |
Thanks for taking a look and testing! I'm happy to look into the issues you found but I'm not fully understanding the steps to reproduce the problems you saw. Here's what happens when I use the Next Error button: And vertical scrolling: |
Well that's working perfectly at your end! Are you on a Mac btw, and using Chrome? And was that via http://localhost:8080/ or via file explorer? e.g. file:///Users/damion/Documents/GitHub/DataHarmonizer/web/dist/index.html after the yarn web.build is done? |
Yes I am on a Mac and using Chrome. I recorded those while using the webpack-dev-server ( Maybe we should just do a quick call some time to see what's going on? It's entirely possible I didn't properly document some part of the workflow. |
…rtFormats methods to be passed to Toolbar as options
Hi Patrick, I see you've made this all up to date with DH v1.3.4 . I'm merging with master now! |
Should I just drop yarn.lock or try repairs in dependabot list: |
Ah sorry I don't have permission to view this repo's dependabot alerts. Don't remove |
Maybe you have permission now to view dependabots? I added you as a write contributor.
d.
|
Refactor for library / interface split
There are a lot of changes here so I'd be glad to walk anyone through them in more detail. Just reach out to me if that would be helpful for you.
The changes fall into these categories:
package.json
, eslint, prettier, webpack and rollup configs). Removed manually copied-in third party dependencies (used to be inlibraries
folder); these are specified inpackage.json
now.script/data-harmonizer
have migrated into the three classes (DataHarmonizer
,Toolbar
,Footer
) inlib
. HTML snippets and CSS required by those classes are also inlib
.lib/utils
contains stateless functions that are used by one or more of the main classes.lib/images
contain images used by the Getting Started carousel provided byToolbar
.web
. This replacesmain.html
,main.js
, andmain.css
that were previously at the top level of the repo. Thetemplates
directory has been moved toweb/templates
to emphasize that those templates are used by that canonical interface and are independent of the core library.var SCHEMA =
part was removed).The development workflow with this branch is:
yarn
to install dependencies.yarn dev
to start the webpack dev server for the canonical DataHarmonizer interface onlocalhost:8080
. This serves as interface for testing and debugging the core library components (in thelib
directory) and that interface itself (theweb
directory).yarn build:web
to bundle the canonical interface. You can openweb/dist/index.html
in your browser to test the distributable bundle and verify it runs in "offline".yarn build:lib
to bundle the library components intolib/dist
. That’s what will be published for downstream clients to use (there will be some follow-up work to document and automate that process). For now there isn’t much interesting to do with it, unless you really want to go the extra mile and consume your local DH project in another local project to see that working.A few points that may warrant discussion:
Toolbar
class, they won't incur the extra bundle size. Regardless, even for ease of updating I wonder if that carousel could be replaced by a link to documentation on the GitHub Wiki.web/templates/menu.js
now includes information about the schema and export formats for each folder. This replaces theSCHEMA
andEXPORT_FORMATS
global variables that were previously used to manage that information. Instead of having theToolbar
class have knowledge about a specific file system structure, I added these two fields to the objects inmenu.js
that can either be inlined values (an object forschema
or an array forexportFormats
) or functions that provide such values. The dynamic imports inmenu.js
are a little awkward looking, but at least it keepsToolbar
's interface quite generic. Curious if anyone has alternate ideas.scripts/linkml.py
. A schema JSON file can be generated from the LinkML YAML on the command line with:gen-linkml --format json --mergeimports schema.yaml > schema.json
.DataHarmonizer
class the same as it was before as much as possible. However I did attempt to remove any references to DOM elements inDataHarmonizer
that it didn't create itself. That required replacingchangeColVisibility
with 4 more specific methods (showAllColumns
,showRequiredColumns
,showRecommendedColumns
,showColumnsBySectionTitle
) Personally I prefer this type of more explicit interface, but that's open to discussion. (It may also be worth in the future looking at what methods and properties onDataHarmonizer
should be public and make the rest private.)Fixes #312