Skip to content
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

build: remove minify and optimization for drawtools and geosearch #1065

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

radupasparuga
Copy link
Collaborator

@radupasparuga radupasparuga commented Jun 26, 2024

Implemented changes

This PR attempts to align our monorepo with Lit's best practices for publishing packages (https://lit.dev/docs/tools/publishing/#don't-bundle-minify-or-optimize-modules)
Todo: (many things in progress)

  • don't minify/optimize/obfuscate code (parent application should be responsible for this)
  • don't bundle src files in a single file (so that parent application can optimize it on their side)
  • package "dist" should be the whole src folder without any vite bundling/optimization etc (2d84ab1)
  • the 2 packages I'm testing this (eox-drawtools and eox-geosearch) use stylings from the root elements repo (e.g. https://github.com/EOX-A/EOxElements/blob/main/elements/drawtools/src/components/controller.js#L3), this obviously breaks when trying to use the package in an app as the styles themselves aren't in the src folder, potential solution would be to only use styles from inside the src folder (e.g. https://github.com/EOX-A/EOxElements/blob/main/elements/geosearch/src/main.js#L7) or, for styles/utils that get re-used across our components create a new package (eox/styles) so we can import them as a dependency (fixed in cfdb001)
  • enable things like code completion/component documentation on hover for components using TS/JSDoc (should probably happen automagically once the first 2 are done)
  • check potential bundle size benefits
    Closes Element publishing improvements #747

How to run

  • currently changes have been made only to eox-drawtools and eox-geosearch
  • cd elements/drawtools
  • npm pack (this will create a tar of the package)
  • cd ~/path-to-test-project
  • npm install ~/path-to-elements-repo/elements/drawtools/eox-drawtools-0.8.1.tgz

Screenshots/Videos

Checklist before requesting a review

Copy link

netlify bot commented Jun 26, 2024

Deploy Preview for eoxelements failed.

Name Link
🔨 Latest commit 82eeacf
🔍 Latest deploy log https://app.netlify.com/sites/eoxelements/deploys/66a75e173a31170007b6ab57

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.

Element publishing improvements
2 participants