npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qiankun-rewrite

v0.0.2

Published

A completed implementation of Micro Frontends

Downloads

4

Readme

qiankun-rewrite

针对 qiankun 关于 Element, Document 原型链上部分方法打上补丁,从而满足元素隔离的需求。

🤔 Motivation

当使用 qiankun 中loadMicroApp方法加载两个相同子应用时,其中会产生样式冲突选择器冲突,由于 sandbox 中开启strictStyleIsolation模式会导致兼容性问题,进而选择了experimentalStyleIsolation模式来解决样式冲突的问题。

而开启该模式会导致类似 antd 中 Modal 框样式丢失的问题

因此萌发了代理 Document\Element 原型链上的的方法,使得子应用操作元素的范围在缩小在其容器内,以下该项目的修改点,可以让你清楚评估风险:

👀 Change Points

  • 📍 基础版本:[email protected]版本拓展。
  • 新增:<qiankun-body>{template}</qiankun-body>容器。
  • 新增:appInstanceMap用于存储 app 实例信息(最外层容器节点)。
  • 注入:document, document.body, document.head打上标记(用于判断是否需要执行 patch)
  • 补丁:Document\Element 原型链上的方法

| Document | Element | | -------------------------- | ---------------------- | | getElementById | querySelector | | getElementsByName | querySelectorAll | | getElementsByClassName | getElementsByClassName | | getElementsByTagName | getElementsByTagName | | querySelector | appendChild | | querySelectorAll | append | | createElement | prepend | | createElementNS | insertBefore | | rawDocumentCreateElementNS | cloneNode | | | removeChild | | | replaceChild |

📦 Installation

$ yarn add qiankun-rewrite  # or npm i qiankun-rewrite -S

📖 TODO

  • [x] 元素隔离
  • [ ] 路由响应隔离(doing)
  • [ ] history 隔离

💿 SelfTest

Inside the examples folder, there is a sample Shell app and multiple mounted Micro FE apps. To get it running, first clone qiankun:

$ git clone https://github.com/umijs/qiankun.git
$ cd qiankun

Now install and run the example:

$ yarn install
$ yarn examples:install
$ yarn examples:start

Visit http://localhost:3000.

🎁 Acknowledgements