question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feature: alternate package entry points

See original GitHub issue

Please describe the feature/suggestion

Many packages offer alternate entry points (e.g. lodash-es/map, rxjs/operators, @rschedule/core/rules, etc). At the moment, it appears that bundlephobia only supports scanning they main entry point of a package (e.g. rxjs).

It would be awesome if, when searching for packages on bundlephobia.com, there was a way of specifying that an alternate entry point should be used. E.g. rxjs/operators@6.5.3

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pastelskycommented, Sep 20, 2019

Fair enough. About #3 though – a package author can still ship both different entry points, as well as named exports.

Good news is, bundlephobia’s core already supports something like this. For the most part things will just work. The part that is going to fail right now is parsing or package strings. Today a string like

rxjs@2.0.0

will simply be split at the @ symbol and a package name and version is derived. Then on, the package and its version is resolved from the npmjs registry. We would need to make the parser smarter about this, and instead give us the package name, import path as well as the package version.

I’m open to taking PRs for this and guide you towards the changes required if your’re interested

0reactions
markeriksoncommented, May 28, 2021

Would be really neat to see this added.

We’re adding a new “RTK Query” API in Redux Toolkit 1.6. The import entry points will be:

// Existing UI-agnostic APIs
import { createSlice } from "@reduxjs/toolkit";
// RTKQ features, UI-agnostic
import { createApi as genericCreateApi } from "@reduxjs/toolkit/query";
// RTKQ features, with React-specific functionality baked in
import { createApi as reactCreateApi } from "@reduxjs/toolkit/query/react";

The RTK Query entry points will add an additional size chunk to a user’s app, and it would be nice to show and distinguish that from the contents of the root entry point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entry points specification - Python Packaging User Guide
Entry points are a mechanism for an installed distribution to advertise components it provides to be discovered and used by other code. For...
Read more >
Entry points - IBM
Alternate entry points are locations, other than the primary entry, which can receive control or be referenced from another module. An alternate entry...
Read more >
node.js - Package.json with multiple entrypoints - Stack Overflow
In a package's package.json file, two fields can define entry points for a package: "main" and "exports". The "main" field is supported in...
Read more >
Demystefying Setuptools Entry Points - YouTube
Phoenix Zerinhttps://nz.pycon.org/schedule/presentation/180/ Entry points are one of the most powerful, yet mysterious, ways to customise the ...
Read more >
Building an Angular Library with multiple entry points | Articles
A npm package can have additional entry points, called secondary entry points (or subentry points). An example is Angular Material which has ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found