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

Use current version of inline-style-prefixer #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kyptin
Copy link

@kyptin kyptin commented May 28, 2021

This crosses the v5.0.0 version, which required some changes to the import paths. All tests still pass.

It turns out crossing this threshold is important for us, because we depend on libraries that depend on post-5.0.0 versions of inline-style-prefixer, and the two versions are incompatible. Node resolves this by allowing multiple versions of a single package in the same project. But we're running this code in browsers, and we're constrained to using a bundler that doesn't support multiple versions. So if we can bump this library to use a post-5.0.0 version, all uses will be compatible.

This crosses the v5.0.0 version, which required some changes to the
import paths. All tests still pass.

It turns out crossing this threshold is important for us, because we
depend on libraries that depend on post-5.0.0 versions of
inline-style-prefixer, and the two versions are incompatible. Node
resolves this by allowing multiple versions of a single package in
the same project. But we're running this code in browsers, and we're
constrained to using a bundler that also doesn't support multiple
versions. So if we can bump this library to use a post-5.0.0
version, all uses will be compatible.
@threepointone
Copy link
Owner

Sorry I haven't been on this project for a while, but this seems like a worthy update. Give me a few days and I'll get this in.

kyptin added a commit to kyptin/shadow-cljs-example-breakage that referenced this pull request Jun 2, 2021
(See previous commit message for context.)

First, we fixed glamor to work with the current version (post-v5) of
inline-style-prefixer (ISP). For full details on those changes, see this
PR we opened: threepointone/glamor#396

After that, we:

- cloned that (forked) version of glamor to vendor/glamor,
- ran `npm install` in that directory,
- ran `npm run build` in that directory to compile the source and make
  library paths available, and
- removed unneeded files with `rm -rf .git node_modules`.

Finally, we added two new dependencies to our project:

- glamor, pointing to the vendored code, and
- ISP at ^6.0.0, which at this point both ui-box and (our local version
  of) glamor can use without a problem.

(For some reason we don't yet understand, only adding glamor wasn't
enough. When we did that, ISP wasn't getting installed at the top level
of node_modules, and Shadow CLJS wasn't able to find it, so we had to
add it as a top-level dep.)

After that and a top-level `npm install`, we could `npm run watch` and
have a working example that used a previously broken feature of
Evergreen.

Credit: Christopher Gsell for pair programming me on this journey.
@tggreene
Copy link

Awesome, thanks @kyptin this has been on my todo list for ages for the exact same use case as yours (evergreen-ui + shadow-cljs), I ended up using webpack to create a separate lib.js as described here.

I'm hoping this will make using evergreen substantially simpler via clojurescript 🎉.

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.

None yet

3 participants