[WIP] examples of using Lion components #45
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Per ProjectEvergreen/greenwood#523 wanted to get an example of Lion working with Greenwood. The intent isn't to merge this PR, but rather provide an example and demonstration for how to add it to a Greenwood project.
Mostly working for development at least. (not the calendar though)
Steps
For the most part, just following the steps for each component's docs worked fine. For example, with Tabs
@lion/tabs
Known Issues
Not sure if related to Greenwood or not, but when running
greenwood develop
, looks like there is an error for regarding Localization?Seems to be a local development issues, as when building for production with a newer version of Rollup, everything looks good for the calendar?
Wonder if it has something to do with ES Module Shims? Found this and not sure if related to the fact that
@lion/calendar
uses dynamicimport()
?Noticing that es-module-shims applies its
importShim
to theseMaybe I need to review since ES Module Shims has gone 1.0 and maybe has some more features / settings we need to use or be aware of?
At least for
<lion-tabs>
, they don't work by default with our puppeteer prerendering.However, when setting
prerender: false
in greenwood.config.js it will workMaybe something to experiment further with as part of ProjectEvergreen/greenwood#709.
Even trying it in an external main.js file doesn't work, so not sure if Greenwood problem or Rollup problem? 🤔
Maybe has something to do with sideEffects and or that I should
extend
these WCs instead?Ah, this just requires an upgrade to Rollup and its dependencies to get support for
exports
andsideEffects
! - ProjectEvergreen/greenwood#746🚫 Development (Exports Map handling)
Saw a couple issues related to exports map support handling when testing these out, which I think are gaps in Greenwood, so would be dependent on an upstream fix from Greenwood -
Flat Export Map
Was getting an error that one Lion's export maps entries (
./define
) was not resolving correctlyI think the issue is I was not correctly handling "flat" export maps, e.g.
Lit - each entry is an object
Lion - each entry is a string
Transient Imports
After fixing the above, I then saw that an
import
of a dependent package was not correctly getting updated in the import map when walking a module.