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

Convert the library to use Signals and reactive elements #2075

Merged
merged 59 commits into from
Sep 11, 2024
Merged

Conversation

binrysearch
Copy link
Contributor

@binrysearch binrysearch commented Sep 11, 2024

This PR updates the entire library to use Signals and reactive elements as opposed to manually managing the DOM elements. This would help eliminate some of the existing bugs and also make the library much easier to maintain long-term.

Here is the gist of the changes:

  • Refactor the existing Tour and Hints constructs to use Signals & reactive elements instead of manually creating and managing element
  • Embed a TypeScript version of Van.js

Copy link

vercel bot commented Sep 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
intro-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 8:55am

Copy link

github-actions bot commented Sep 11, 2024

Size Change: +11.1 kB (+28.1%) 🚨

Total Size: 50.7 kB

Filename Size Change
dist/intro.js 17.1 kB +2.68 kB (+18.56%) ⚠️
dist/intro.module.js 16.5 kB +5.78 kB (+53.69%) 🆘
dist/minified/intro.min.js 17.1 kB +2.68 kB (+18.55%) ⚠️

compressed-size-action

@afshinm
Copy link
Contributor

afshinm commented Sep 11, 2024

Awesome! :) We should optimise the new components to reduce the bundle size. Looks great overall.

this: Hint,
hintElement: HTMLElement,
item: HintItem,
stepId: number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a backward incompatible change and should be announced.


const root = div(
{
className: "introjs-tour",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be great to colocate the classNames, too

if (step >= this._currentStep) {
if (
this._currentStepSignal.val === undefined ||
step >= this._currentStepSignal.val
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use this.getCurrentStep()?

@binrysearch binrysearch merged commit faef906 into master Sep 11, 2024
5 checks passed
@binrysearch binrysearch deleted the reactive branch September 11, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants